pub struct UsmUserConfig {
pub username: Bytes,
pub auth: Option<(AuthProtocol, Vec<u8>)>,
pub privacy: Option<(PrivProtocol, Vec<u8>)>,
}Expand description
USM user credentials for V3 notification handling.
Stores the authentication and privacy settings for a single USM user.
Fields§
§username: BytesUsername
auth: Option<(AuthProtocol, Vec<u8>)>Authentication protocol and password
privacy: Option<(PrivProtocol, Vec<u8>)>Privacy protocol and password
Implementations§
Source§impl UsmUserConfig
impl UsmUserConfig
Sourcepub fn new(username: impl Into<Bytes>) -> Self
pub fn new(username: impl Into<Bytes>) -> Self
Create a new USM user config with no authentication (noAuthNoPriv).
Sourcepub fn auth(self, protocol: AuthProtocol, password: &[u8]) -> Self
pub fn auth(self, protocol: AuthProtocol, password: &[u8]) -> Self
Add authentication (authNoPriv or authPriv).
Sourcepub fn privacy(self, protocol: PrivProtocol, password: &[u8]) -> Self
pub fn privacy(self, protocol: PrivProtocol, password: &[u8]) -> Self
Add privacy/encryption (authPriv).
Sourcepub fn security_level(&self) -> SecurityLevel
pub fn security_level(&self) -> SecurityLevel
Get the security level based on configured auth/privacy.
Trait Implementations§
Source§impl Clone for UsmUserConfig
impl Clone for UsmUserConfig
Source§fn clone(&self) -> UsmUserConfig
fn clone(&self) -> UsmUserConfig
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 moreAuto Trait Implementations§
impl !Freeze for UsmUserConfig
impl RefUnwindSafe for UsmUserConfig
impl Send for UsmUserConfig
impl Sync for UsmUserConfig
impl Unpin for UsmUserConfig
impl UnwindSafe for UsmUserConfig
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