Trait ConnectionState

Source
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 feature h3 only.
Expand description

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

Required Methods§

Source

fn shared_state(&self) -> &SharedState

Get the shared state

Provided Methods§

Source

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

Source

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

tries to set the connection error

Source

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

set the connection error and wake the connection

Source

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

Get the settings

Source

fn set_closing(&self)

Set the connection to closing

Source

fn is_closing(&self) -> bool

Check if the connection is closing

Source

fn set_settings(&self, settings: Settings)

Set the settings

Source

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§

Source§

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

Source§

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

Implementors§

Source§

impl ConnectionState for SharedState

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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