pub struct Info { /* private fields */ }
Expand description
This struct represents information about the currently connected server.
It is passed to Handler::init
and the Init
handler.
Implementations§
source§impl Info
impl Info
sourcepub fn server_description(&self) -> &str
pub fn server_description(&self) -> &str
Returns a user-displayable description of the server. This might be a string like “trillium x.y.z (trillium-tokio x.y.z)” or “my special application”.
sourcepub fn listener_description(&self) -> &str
pub fn listener_description(&self) -> &str
Returns a user-displayable string description of the location
or port the listener is bound to, potentially as a url. Do not
rely on the format of this string, as it will vary between
server implementations and is intended for user
display. Instead, use Info::tcp_socket_addr
for any
processing.
sourcepub const fn tcp_socket_addr(&self) -> Option<&SocketAddr>
pub const 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 server_description_mut(&mut self) -> &mut String
pub fn server_description_mut(&mut self) -> &mut String
obtain a mutable borrow of the server description, suitable for appending information or replacing it
sourcepub fn listener_description_mut(&mut self) -> &mut String
pub fn listener_description_mut(&mut self) -> &mut String
obtain a mutable borrow of the listener description, suitable for appending information or replacing it