pub struct ContextData { /* private fields */ }Expand description
Represents the internal state of the application context.
This structure holds all the data associated with a single request-response cycle, including the socket, request, response, and any custom attributes.
Implementations§
Source§impl ContextData
Implementation of methods for ContextData.
impl ContextData
Implementation of methods for ContextData.
Sourcepub fn new(
socket: ArcRwLockUdpSocket,
request: Request,
client_addr: SocketAddr,
) -> Self
pub fn new( socket: ArcRwLockUdpSocket, request: Request, client_addr: SocketAddr, ) -> Self
Sourcepub fn get_aborted(&self) -> bool
pub fn get_aborted(&self) -> bool
Sourcepub fn set_aborted(&mut self, aborted: bool)
pub fn set_aborted(&mut self, aborted: bool)
Sourcepub fn get_socket(&self) -> Option<ArcRwLockUdpSocket>
pub fn get_socket(&self) -> Option<ArcRwLockUdpSocket>
Sourcepub fn get_request(&self) -> &Request
pub fn get_request(&self) -> &Request
Sourcepub fn get_response(&self) -> &Response
pub fn get_response(&self) -> &Response
Sourcepub fn get_response_mut(&mut self) -> &mut Response
pub fn get_response_mut(&mut self) -> &mut Response
Sourcepub fn get_client_addr(&self) -> Option<SocketAddr>
pub fn get_client_addr(&self) -> Option<SocketAddr>
Sourcepub fn get_attributes(&self) -> &ThreadSafeAttributeStore
pub fn get_attributes(&self) -> &ThreadSafeAttributeStore
Sourcepub fn get_attributes_mut(&mut self) -> &mut ThreadSafeAttributeStore
pub fn get_attributes_mut(&mut self) -> &mut ThreadSafeAttributeStore
Gets the attributes mutably.
§Returns
&mut ThreadSafeAttributeStore- Mutable reference to the attributes.
Trait Implementations§
Source§impl Clone for ContextData
impl Clone for ContextData
Source§fn clone(&self) -> ContextData
fn clone(&self) -> ContextData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContextData
impl !RefUnwindSafe for ContextData
impl Send for ContextData
impl Sync for ContextData
impl Unpin for ContextData
impl UnsafeUnpin for ContextData
impl !UnwindSafe for ContextData
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