Struct ext2::xattr::XattrEntry
source · #[repr(C)]pub(crate) struct XattrEntry {
name_len: u8,
name_index: u8,
value_offs: u16,
value_inum: u32,
value_size: u32,
hash: u32,
}
Fields§
§name_len: u8
§name_index: u8
§value_offs: u16
§value_inum: u32
§value_size: u32
§hash: u32
Implementations§
source§impl XattrEntry
impl XattrEntry
sourcepub(crate) fn new_with_name<'a>(
name: &'a [u8],
value: &[u8],
value_offs: u16
) -> Result<(Self, &'a [u8])>
pub(crate) fn new_with_name<'a>( name: &'a [u8], value: &[u8], value_offs: u16 ) -> Result<(Self, &'a [u8])>
Creates a new XattrEntry
instance with the name as a byte sequence that follows.
sourcefn split_key_prefix(name: &[u8]) -> (u8, &[u8])
fn split_key_prefix(name: &[u8]) -> (u8, &[u8])
Split the given xatrr key string into it’s prefix’s name index and the remaining part. e.g. “user.foo” -> (1, “foo”) because the key prefix “user.” has index 1.
Trait Implementations§
source§impl AsBytes for XattrEntry
impl AsBytes for XattrEntry
§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
§fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>
source§impl Clone for XattrEntry
impl Clone for XattrEntry
source§fn clone(&self) -> XattrEntry
fn clone(&self) -> XattrEntry
Returns a copy 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 XattrEntry
impl Debug for XattrEntry
source§impl Default for XattrEntry
impl Default for XattrEntry
source§fn default() -> XattrEntry
fn default() -> XattrEntry
Returns the “default value” for a type. Read more
source§impl FromBytes for XattrEntry
impl FromBytes for XattrEntry
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
Interprets the prefix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
Interprets the suffix of the given
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + AsBytes,
Interprets the prefix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + AsBytes,
Interprets the suffix of the given
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
fn read_from_prefix(bytes: &[u8]) -> Option<Self>where
Self: Sized,
source§impl FromZeroes for XattrEntry
impl FromZeroes for XattrEntry
impl Copy for XattrEntry
Auto Trait Implementations§
impl RefUnwindSafe for XattrEntry
impl Send for XattrEntry
impl Sync for XattrEntry
impl Unpin for XattrEntry
impl UnwindSafe for XattrEntry
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