pub struct Sid { /* private fields */ }Expand description
A Windows security identifier (SID).
The text form is canonical S-1-... notation and the binary helpers use
the native Windows packet layout.
Implementations§
Source§impl Sid
impl Sid
Sourcepub fn new(
identifier_authority: impl Into<SidIdentifierAuthority>,
sub_authorities: impl IntoIterator<Item = u32>,
) -> Result<Self, SidError>
pub fn new( identifier_authority: impl Into<SidIdentifierAuthority>, sub_authorities: impl IntoIterator<Item = u32>, ) -> Result<Self, SidError>
Creates a revision-1 SID from its identifier authority and sub-authorities.
The authority must fit in 48 bits and a SID must have one through 15 sub-authorities.
Sourcepub const fn revision(&self) -> SidRevision
pub const fn revision(&self) -> SidRevision
Returns the SID revision.
Returns the identifier authority
Returns the SID sub-authorities.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SidError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SidError>
Parses a Windows-native SID packet.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sid
impl<'de> Deserialize<'de> for Sid
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Sid
Source§impl From<WellKnownSid> for Sid
impl From<WellKnownSid> for Sid
Source§fn from(value: WellKnownSid) -> Self
fn from(value: WellKnownSid) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Sid
Auto Trait Implementations§
impl Freeze for Sid
impl RefUnwindSafe for Sid
impl Send for Sid
impl Sync for Sid
impl Unpin for Sid
impl UnsafeUnpin for Sid
impl UnwindSafe for Sid
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