pub struct ContextBuilder { /* private fields */ }Expand description
Builder for SessionContext objects.
Implementations§
Source§impl ContextBuilder
impl ContextBuilder
Sourcepub fn new(user: String) -> Self
pub fn new(user: String) -> Self
Creates a new builder with default values for the various fields.
Sourcepub fn remote_address(&mut self, remote_address: String) -> &mut Self
pub fn remote_address(&mut self, remote_address: String) -> &mut Self
Sets the remote address of the resulting context.
Sourcepub fn privilege_level(&mut self, privilege_level: PrivilegeLevel) -> &mut Self
pub fn privilege_level(&mut self, privilege_level: PrivilegeLevel) -> &mut Self
Sets the privilege level of the resulting context.
Sourcepub fn auth_method(&mut self, method: AuthenticationMethod) -> &mut Self
pub fn auth_method(&mut self, method: AuthenticationMethod) -> &mut Self
Sets the authentication method of the resulting context.
Note that this field is ignored in an authentication session.
Sourcepub fn build(&self) -> SessionContext
pub fn build(&self) -> SessionContext
Consumes this builder and turns it into a SessionContext.
Trait Implementations§
Source§impl Clone for ContextBuilder
impl Clone for ContextBuilder
Source§fn clone(&self) -> ContextBuilder
fn clone(&self) -> ContextBuilder
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 moreSource§impl Debug for ContextBuilder
impl Debug for ContextBuilder
Source§impl Hash for ContextBuilder
impl Hash for ContextBuilder
Source§impl PartialEq for ContextBuilder
impl PartialEq for ContextBuilder
impl Eq for ContextBuilder
impl StructuralPartialEq for ContextBuilder
Auto Trait Implementations§
impl Freeze for ContextBuilder
impl RefUnwindSafe for ContextBuilder
impl Send for ContextBuilder
impl Sync for ContextBuilder
impl Unpin for ContextBuilder
impl UnwindSafe for ContextBuilder
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