pub trait FromDisconnectParts<A: Adapter>: Sized {
type Error: Error + 'static;
// Required method
fn from_disconnect_parts(
s: &Arc<Socket<A>>,
reason: DisconnectReason,
) -> Result<Self, Self::Error>;
}Expand description
A trait used to extract the arguments from the disconnect event.
The Result associated type is used to return an error if the extraction fails,
in this case the DisconnectHandler is not called.
- See the
disconnectmodule doc for more details on disconnect handler. - See the
extractmodule doc for more details on available extractors.
Required Associated Types§
Required Methods§
Sourcefn from_disconnect_parts(
s: &Arc<Socket<A>>,
reason: DisconnectReason,
) -> Result<Self, Self::Error>
fn from_disconnect_parts( s: &Arc<Socket<A>>, reason: DisconnectReason, ) -> Result<Self, Self::Error>
Extract the arguments from the disconnect 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", so this trait is not object safe.
Implementors§
Source§impl<A: Adapter> FromDisconnectParts<A> for ProtocolVersion
impl<A: Adapter> FromDisconnectParts<A> for ProtocolVersion
type Error = Infallible
Source§impl<A: Adapter> FromDisconnectParts<A> for TransportType
impl<A: Adapter> FromDisconnectParts<A> for TransportType
type Error = Infallible
Source§impl<A: Adapter> FromDisconnectParts<A> for DisconnectReason
impl<A: Adapter> FromDisconnectParts<A> for DisconnectReason
type Error = Infallible
Source§impl<A: Adapter> FromDisconnectParts<A> for SocketRef<A>
impl<A: Adapter> FromDisconnectParts<A> for SocketRef<A>
type Error = Infallible
Source§impl<A: Adapter> FromDisconnectParts<A> for SocketIo<A>
impl<A: Adapter> FromDisconnectParts<A> for SocketIo<A>
type Error = Infallible
Source§impl<A: Adapter, T: Clone + Send + Sync + 'static> FromDisconnectParts<A> for Extension<T>
Available on crate feature extensions only.
impl<A: Adapter, T: Clone + Send + Sync + 'static> FromDisconnectParts<A> for Extension<T>
Available on crate feature
extensions only.type Error = ExtensionNotFound<T>
Source§impl<A: Adapter, T: Clone + Send + Sync + 'static> FromDisconnectParts<A> for HttpExtension<T>
impl<A: Adapter, T: Clone + Send + Sync + 'static> FromDisconnectParts<A> for HttpExtension<T>
type Error = ExtensionNotFound<T>
Source§impl<A: Adapter, T: Clone + Send + Sync + 'static> FromDisconnectParts<A> for MaybeExtension<T>
Available on crate feature extensions only.
impl<A: Adapter, T: Clone + Send + Sync + 'static> FromDisconnectParts<A> for MaybeExtension<T>
Available on crate feature
extensions only.