pub struct Acl { /* private fields */ }
Expand description
The ACL structure is the header of an access control list (ACL). A complete ACL consists of an ACL structure followed by an ordered list of zero or more access control entries (ACEs).
https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-acl
Implementations§
Source§impl Acl
impl Acl
Sourcepub fn acl_revision(&self) -> &Revision
pub fn acl_revision(&self) -> &Revision
Specifies the revision level of the ACL. This value should be ACL_REVISION, unless the ACL contains an object-specific ACE, in which case this value must be ACL_REVISION_DS. All ACEs in an ACL must be at the same revision level.
Sourcepub fn acl_size(&self) -> &u16
pub fn acl_size(&self) -> &u16
Specifies the size, in bytes, of the ACL. This value includes the ACL structure, all the ACEs, and the potential unused memory.
pub fn ace_list(&self) -> &Vec<Ace>
pub fn acl_type(&self) -> &Type
pub fn control_flags(&self) -> &ControlFlags
Source§impl Acl
impl Acl
pub fn new( acl_revision: Revision, acl_type: Type, control_flags: ControlFlags, ace_list: Vec<Ace>, ) -> Self
Sourcepub fn from_sddl(value: &str, domain_rid: Option<&[u32]>) -> Result<Self, Error>
pub fn from_sddl(value: &str, domain_rid: Option<&[u32]>) -> Result<Self, Error>
parses an SDDL string
§Example
use sddl::*;
let acl = Acl::from_sddl("D:P(A;CIOI;GRGX;;;BU)(A;CIOI;GA;;;BA)(A;CIOI;GA;;;SY)(A;CIOI;GA;;;CO)", None).unwrap();
assert_eq!(*acl.acl_type(), acl::Type::DACL);
assert_eq!(*acl.ace_count(), 4);
pub fn sddl_string(&self) -> String
Trait Implementations§
Source§impl BinRead for Acl
impl BinRead for Acl
Source§type Args<'__binrw_generated_args_lifetime> = (ControlFlags, Type)
type Args<'__binrw_generated_args_lifetime> = (ControlFlags, Type)
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Read
Self
from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Read
Self
from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Read
Self
from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
Read
T
from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self
from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self
from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for Acl
impl BinWrite for Acl
Source§type Args<'__binrw_generated_args_lifetime> = (ControlFlags, Type)
type Args<'__binrw_generated_args_lifetime> = (ControlFlags, Type)
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self
to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self
to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self
to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Write
Self
to the writer assuming native-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self
to the writer using the given arguments. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Write
Self
to the writer, assuming big-endian byte order, using the
given arguments. Read moreSource§impl ReadEndian for Acl
impl ReadEndian for Acl
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
Source§impl WriteEndian for Acl
impl WriteEndian for Acl
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
The endianness of the type.
impl Eq for Acl
Auto Trait Implementations§
impl Freeze for Acl
impl RefUnwindSafe for Acl
impl Send for Acl
impl Sync for Acl
impl Unpin for Acl
impl UnwindSafe for Acl
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