Skip to main content

SampleLocalServerHandler

Trait SampleLocalServerHandler 

Source
pub trait SampleLocalServerHandler<___T: Transport = Channel> {
    // Required methods
    fn set(&mut self, request: Request<Set, ___T>) -> impl Future<Output = ()>;
    fn commit(
        &mut self,
        request: Request<Commit, ___T>,
        responder: Responder<Commit, ___T>,
    ) -> impl Future<Output = ()>;

    // Provided method
    fn on_unknown_interaction(
        &mut self,
        ordinal: u64,
    ) -> impl Future<Output = ()> { ... }
}
Expand description

A server handler for the Sample protocol.

See Sample for more details.

Required Methods§

Source

fn set(&mut self, request: Request<Set, ___T>) -> impl Future<Output = ()>

Add sample parameters.

Since this is limited by channel size, this API paginates at 300 items. That should fit in a channel unless a selector is particularly gigantic.

Use Commit to indicate that all samples are sent over.

Source

fn commit( &mut self, request: Request<Commit, ___T>, responder: Responder<Commit, ___T>, ) -> impl Future<Output = ()>

Commit returns errors quickly, as all configuration is validated before the first sample is taken.

Provided Methods§

Source

fn on_unknown_interaction(&mut self, ordinal: u64) -> impl Future<Output = ()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<___H, ___T> SampleLocalServerHandler<___T> for Local<___H>
where ___H: SampleServerHandler<___T>, ___T: Transport,

Source§

async fn set(&mut self, request: Request<Set, ___T>)

Source§

async fn commit( &mut self, request: Request<Commit, ___T>, responder: Responder<Commit, ___T>, )

Source§

async fn on_unknown_interaction(&mut self, ordinal: u64)

Implementors§