Skip to main content

SampleServerHandler

Trait SampleServerHandler 

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

    // Provided method
    fn on_unknown_interaction(
        &mut self,
        ordinal: u64,
    ) -> impl Future<Output = ()> + Send { ... }
}
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 = ()> + Send

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 = ()> + Send

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 = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§