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§
Get the shared state
Provided Methods§
Sourcefn 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
Sourcefn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin
fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin
tries to set the connection error
Sourcefn 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
Sourcefn set_closing(&self)
fn set_closing(&self)
Set the connection to closing
Sourcefn is_closing(&self) -> bool
fn is_closing(&self) -> bool
Check if the connection is closing
Sourcefn set_settings(&self, settings: Settings)
fn set_settings(&self, settings: Settings)
Set the settings
Sourcefn 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.