ConnectionState

Trait ConnectionState 

pub trait ConnectionState {
    // Required method
    fn shared_state(&self) -> &SharedState;

    // Provided methods
    fn get_conn_error(&self) -> Option<ErrorOrigin> { ... }
    fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin { ... }
    fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOrigin
       where T: Into<ErrorOrigin> { ... }
    fn settings(&self) -> Cow<'_, Settings> { ... }
    fn set_closing(&self) { ... }
    fn is_closing(&self) -> bool { ... }
    fn set_settings(&self, settings: Settings) { ... }
    fn waker(&self) -> &AtomicWaker { ... }
}
Available on crate features quic and h3 only.
Expand description

This trait can be implemented for all types which have a shared state

Required Methods§

fn shared_state(&self) -> &SharedState

Get the shared state

Provided Methods§

fn get_conn_error(&self) -> Option<ErrorOrigin>

Get the connection error if the connection is in error state because of another task

Return the error as an Err variant if it is set in order to allow using ? in the calling function

fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin

tries to set the connection error

fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOrigin
where T: Into<ErrorOrigin>,

set the connection error and wake the connection

fn settings(&self) -> Cow<'_, Settings>

Get the settings

fn set_closing(&self)

Set the connection to closing

fn is_closing(&self) -> bool

Check if the connection is closing

fn set_settings(&self, settings: Settings)

Set the settings

fn waker(&self) -> &AtomicWaker

Returns the waker for the connection

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.

Implementations on Foreign Types§

§

impl<H> ConnectionState for DatagramReader<H>
where H: RecvDatagram,

§

impl<H, B> ConnectionState for DatagramSender<H, B>
where H: SendDatagram<B>, B: Buf,

Implementors§

§

impl ConnectionState for SharedState

§

impl<B, C> ConnectionState for ConnectionInner<C, B>
where C: Connection<B>, B: Buf,

§

impl<C, B> ConnectionState for compio::quic::h3::client::Connection<C, B>
where C: Connection<B>, B: Buf,

§

impl<C, B> ConnectionState for compio::quic::h3::server::Connection<C, B>
where C: Connection<B>, B: Buf,

§

impl<C, B> ConnectionState for RequestResolver<C, B>
where C: Connection<B>, B: Buf,

§

impl<S, B> ConnectionState for compio::quic::h3::client::RequestStream<S, B>

§

impl<S, B> ConnectionState for compio::quic::h3::connection::RequestStream<S, B>

§

impl<S, B> ConnectionState for compio::quic::h3::server::RequestStream<S, B>

§

impl<T, B> ConnectionState for SendRequest<T, B>
where T: OpenStreams<B>, B: Buf,