pub struct Info(/* private fields */);Expand description
This struct represents information about the currently connected server.
It is passed to Handler::init.
Implementations§
Source§impl Info
impl Info
Sourcepub fn tcp_socket_addr(&self) -> Option<&SocketAddr>
pub fn tcp_socket_addr(&self) -> Option<&SocketAddr>
Returns the local_addr of a bound tcp listener, if such a
thing exists for this server
Sourcepub fn unix_socket_addr(&self) -> Option<&SocketAddr>
pub fn unix_socket_addr(&self) -> Option<&SocketAddr>
Returns the local_addr of a bound unix listener, if such a
thing exists for this server
Sourcepub fn insert_state<T>(&mut self, value: T) -> Option<T>
pub fn insert_state<T>(&mut self, value: T) -> Option<T>
Insert a type into the shared state typeset, returning the previous value if any
Sourcepub fn state_entry<T>(&mut self) -> Entry<'_, T>
pub fn state_entry<T>(&mut self) -> Entry<'_, T>
Returns an Entry into the shared state typeset.
Sourcepub fn with_state<T>(self, value: T) -> Info
pub fn with_state<T>(self, value: T) -> Info
chainable interface to insert a type into the shared state typeset
Sourcepub fn config(&self) -> &HttpConfig
pub fn config(&self) -> &HttpConfig
borrow the http config
Sourcepub fn config_mut(&mut self) -> &mut HttpConfig
pub fn config_mut(&mut self) -> &mut HttpConfig
mutate the http config
Trait Implementations§
Source§impl From<HttpContext> for Info
impl From<HttpContext> for Info
Source§fn from(value: HttpContext) -> Info
fn from(value: HttpContext) -> Info
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Info
impl !RefUnwindSafe for Info
impl Send for Info
impl Sync for Info
impl Unpin for Info
impl UnsafeUnpin for Info
impl !UnwindSafe for Info
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