pub struct PrivilegeLevel(/* private fields */);Expand description
A privilege level for authentication. Limited to the range 0-15, inclusive.
Implementations§
Source§impl PrivilegeLevel
impl PrivilegeLevel
Sourcepub fn new(level: u8) -> Option<Self>
pub fn new(level: u8) -> Option<Self>
Converts an integer to a PrivilegeLevel if it is in the proper range (0-15).
§Examples
use tacacs_plus_protocol::PrivilegeLevel;
let valid_level = PrivilegeLevel::new(3);
assert!(valid_level.is_some());
let too_big = PrivilegeLevel::new(42);
assert!(too_big.is_none());Trait Implementations§
Source§impl Clone for PrivilegeLevel
impl Clone for PrivilegeLevel
Source§fn clone(&self) -> PrivilegeLevel
fn clone(&self) -> PrivilegeLevel
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 PrivilegeLevel
impl Debug for PrivilegeLevel
Source§impl Default for PrivilegeLevel
impl Default for PrivilegeLevel
Source§impl Display for PrivilegeLevel
impl Display for PrivilegeLevel
Source§impl Hash for PrivilegeLevel
impl Hash for PrivilegeLevel
Source§impl Ord for PrivilegeLevel
impl Ord for PrivilegeLevel
Source§fn cmp(&self, other: &PrivilegeLevel) -> Ordering
fn cmp(&self, other: &PrivilegeLevel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PrivilegeLevel
impl PartialEq for PrivilegeLevel
Source§impl PartialOrd for PrivilegeLevel
impl PartialOrd for PrivilegeLevel
impl Copy for PrivilegeLevel
impl Eq for PrivilegeLevel
impl StructuralPartialEq for PrivilegeLevel
Auto Trait Implementations§
impl Freeze for PrivilegeLevel
impl RefUnwindSafe for PrivilegeLevel
impl Send for PrivilegeLevel
impl Sync for PrivilegeLevel
impl Unpin for PrivilegeLevel
impl UnwindSafe for PrivilegeLevel
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