BomPath

Struct BomPath 

Source
pub struct BomPath { /* private fields */ }
Expand description

Represents a full path in a BOM.

This is a higher-level data structure with a Rust friendly API. It has fields for all the data constituting a path in a BOM.

Implementations§

Source§

impl BomPath

Source

pub fn from_record( path: String, record: &BomBlockPathRecord<'_>, ) -> Result<Self, Error>

Construct an instance from a low-level BOM record.

Source

pub fn path_type(&self) -> BomPathType

The type of this path.

Source

pub fn path(&self) -> &str

The full path of this instance.

Source

pub fn file_mode(&self) -> u16

File mode bitfield.

Source

pub fn set_file_mode(&mut self, mode: u16) -> u16

Set the file mode to an explicit value.

Source

pub fn symbolic_mode(&self) -> String

Obtain the symbolic file mode for this path.

e.g. a string like drwxr-xr-x.

Source

pub fn user_id(&self) -> u32

Numeric user identifier (UID) that owns this path.

Source

pub fn set_user_id(&mut self, uid: u32) -> u32

Set the user identifier (UID) that owns this path.

Source

pub fn group_id(&self) -> u32

Numeric group identifier (GID) that owns this path.

Source

pub fn set_group_id(&mut self, gid: u32) -> u32

Set the group identifier (GID) that owns this path.

Source

pub fn modified_time(&self) -> &DateTime<Utc>

Modified time of this path.

Source

pub fn set_modified_time(&mut self, mtime: DateTime<Utc>) -> DateTime<Utc>

Set the modified time of this path.

Source

pub fn size(&self) -> usize

Size of path in bytes.

Source

pub fn set_size(&mut self, size: usize) -> usize

Set the size of this path.

Source

pub fn crc32(&self) -> Option<u32>

CRC32 of this path.

Should only be set for files and links.

Source

pub fn set_crc32(&mut self, value: Option<u32>) -> Option<u32>

Set the CRC32 of this path.

The path that this link refers to.

The path that this link refers to, as a CString.

Set the link name for this path.

Trait Implementations§

Source§

impl Clone for BomPath

Source§

fn clone(&self) -> BomPath

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BomPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.