Skip to main content

FromMessageParts

Trait FromMessageParts 

Source
pub trait FromMessageParts<A: Adapter>: Sized {
    type Error: Error + 'static;

    // Required method
    fn from_message_parts(
        s: &Arc<Socket<A>>,
        v: &mut Value,
        ack_id: &Option<i64>,
    ) -> Result<Self, Self::Error>;
}
Expand description

A trait used to extract arguments from the message event. The Result associated type is used to return an error if the extraction fails, in this case the handler is not called.

  • See the message module doc for more details on message handler.
  • See the extract module doc for more details on available extractors.

Required Associated Types§

Source

type Error: Error + 'static

The error type returned by the extractor

Required Methods§

Source

fn from_message_parts( s: &Arc<Socket<A>>, v: &mut Value, ack_id: &Option<i64>, ) -> Result<Self, Self::Error>

Extract the arguments from the message event. If it fails, the handler is not called.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<A: Adapter, T: Clone + Send + Sync + 'static> FromMessageParts<A> for Extension<T>

Available on crate feature extensions only.
Source§

impl<A: Adapter, T: Clone + Send + Sync + 'static> FromMessageParts<A> for HttpExtension<T>

Source§

impl<A: Adapter, T: Clone + Send + Sync + 'static> FromMessageParts<A> for MaybeExtension<T>

Available on crate feature extensions only.
Source§

impl<A: Adapter, T: Clone + Send + Sync + 'static> FromMessageParts<A> for MaybeHttpExtension<T>

Source§

impl<A: Adapter, T: Clone + Send + Sync + 'static> FromMessageParts<A> for State<T>

Available on crate feature state only.
Source§

impl<A: Adapter> FromMessageParts<A> for AckSender<A>

Source§

impl<A: Adapter> FromMessageParts<A> for ProtocolVersion

Source§

impl<A: Adapter> FromMessageParts<A> for SocketIo<A>

Source§

impl<A: Adapter> FromMessageParts<A> for SocketRef<A>

Source§

impl<A: Adapter> FromMessageParts<A> for TransportType

Source§

impl<A> FromMessageParts<A> for Event
where A: Adapter,

Source§

impl<T, A> FromMessageParts<A> for Data<T>

Source§

impl<T, A> FromMessageParts<A> for TryData<T>