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§
Get the shared state
Provided Methods§
fn get_conn_error(&self) -> Option<ErrorOrigin>
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
fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin
tries to set the connection error
fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOriginwhere
T: Into<ErrorOrigin>,
fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOriginwhere
T: Into<ErrorOrigin>,
set the connection error and wake the connection
fn set_closing(&self)
fn set_closing(&self)
Set the connection to closing
fn is_closing(&self) -> bool
fn is_closing(&self) -> bool
Check if the connection is closing
fn set_settings(&self, settings: Settings)
fn set_settings(&self, settings: Settings)
Set the settings
fn waker(&self) -> &AtomicWaker
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.