Skip to main content

EnableServerRequestsHandler

Trait EnableServerRequestsHandler 

Source
pub trait EnableServerRequestsHandler<B> {
    type Action: Action;

    // Required methods
    fn validate_data(&self, data: &Data);
    fn handle<'a>(
        &'a self,
        sender: Requestor<Self::Action, B>,
        data: &'a Data,
        session: &'a Session,
    ) -> PinnedFuture<'a, Result<(), Error>> ;
}
Available on crate feature connection only.

Required Associated Types§

Required Methods§

Source

fn validate_data(&self, data: &Data)

if the data is not available just panic

Source

fn handle<'a>( &'a self, sender: Requestor<Self::Action, B>, data: &'a Data, session: &'a Session, ) -> PinnedFuture<'a, Result<(), Error>>

handles a message with Self::ACTION as action.

if None is returned the request is abandoned and the requestor receives a RequestDropped error

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§