pub struct Context { /* private fields */ }Expand description
Context passed to authentication handlers.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new(
user: impl Into<String>,
remote_addr: SocketAddr,
local_addr: SocketAddr,
) -> Self
pub fn new( user: impl Into<String>, remote_addr: SocketAddr, local_addr: SocketAddr, ) -> Self
Creates a new context.
Sourcepub fn remote_addr(&self) -> SocketAddr
pub fn remote_addr(&self) -> SocketAddr
Returns the remote address.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Returns the local address.
Sourcepub fn client_version(&self) -> &str
pub fn client_version(&self) -> &str
Returns the client version string.
Sourcepub fn set_client_version(&mut self, version: impl Into<String>)
pub fn set_client_version(&mut self, version: impl Into<String>)
Sets the client version string.
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