pub struct Context(/* private fields */);
Expand description
Context structure.
Wraps InnerContext
providing thread-safe shared access.
Implementations§
Source§impl Context
Provides thread-safe access and manipulation of the context.
impl Context
Provides thread-safe access and manipulation of the context.
Sourcepub async fn get_read_lock(&self) -> RwLockReadContext<'_>
pub async fn get_read_lock(&self) -> RwLockReadContext<'_>
Sourcepub async fn get_write_lock(&self) -> RwLockWriteContext<'_>
pub async fn get_write_lock(&self) -> RwLockWriteContext<'_>
Sourcepub async fn get(&self) -> InnerContext
pub async fn get(&self) -> InnerContext
Sourcepub async fn get_stream(&self) -> OptionArcRwLockStream
pub async fn get_stream(&self) -> OptionArcRwLockStream
Sourcepub async fn get_request(&self) -> Request
pub async fn get_request(&self) -> Request
Sourcepub async fn get_response(&self) -> Response
pub async fn get_response(&self) -> Response
Sourcepub async fn get_socket_addr(&self) -> OptionSocketAddr
pub async fn get_socket_addr(&self) -> OptionSocketAddr
Sourcepub async fn get_socket_addr_or_default(&self) -> SocketAddr
pub async fn get_socket_addr_or_default(&self) -> SocketAddr
Sourcepub async fn get_socket_addr_string(&self) -> Option<String>
pub async fn get_socket_addr_string(&self) -> Option<String>
Sourcepub async fn get_socket_addr_or_default_string(&self) -> String
pub async fn get_socket_addr_or_default_string(&self) -> String
Sourcepub async fn get_socket_host(&self) -> OptionSocketHost
pub async fn get_socket_host(&self) -> OptionSocketHost
Sourcepub async fn get_socket_port(&self) -> OptionSocketPort
pub async fn get_socket_port(&self) -> OptionSocketPort
Sourcepub async fn send<T: Into<ResponseData>>(&self, data: T) -> ResponseResult
pub async fn send<T: Into<ResponseData>>(&self, data: T) -> ResponseResult
Sourcepub async fn close(&self) -> ResponseResult
pub async fn close(&self) -> ResponseResult
Sourcepub async fn flush(&self) -> ResponseResult
pub async fn flush(&self) -> ResponseResult
Sourcepub async fn set_data_value<T: Any + Send + Sync + Clone>(
&self,
key: &str,
value: &T,
) -> &Self
pub async fn set_data_value<T: Any + Send + Sync + Clone>( &self, key: &str, value: &T, ) -> &Self
Sourcepub async fn remove_data_value(&self, key: &str) -> &Self
pub async fn remove_data_value(&self, key: &str) -> &Self
Sourcepub async fn clear_data(&self) -> &Self
pub async fn clear_data(&self) -> &Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more