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 listeners(&self) -> &[Listener]
pub fn listeners(&self) -> &[Listener]
Returns every Listener this server is bound to, in registration order.
Empty until the server populates its listener set during startup.
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
Borrow a type from the shared state TypeSet on this Info.
Insert a type into the shared state typeset, returning the previous value if any
Mutate a type in the shared state typeset
Returns an Entry into the shared state typeset.
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) -> Self
fn from(value: HttpContext) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Info
impl !UnwindSafe for Info
impl Freeze for Info
impl Send for Info
impl Sync for Info
impl Unpin for Info
impl UnsafeUnpin 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