Skip to main content

PathList

Struct PathList 

Source
pub struct PathList { /* private fields */ }

Implementations§

Source§

impl PathList

Source

pub const END_NODE: u64 = u64::MAX

Source

pub fn from_directory_contents( dir: &str, path: Option<&str>, flags: ArchiveFlags, n_threads: i32, ) -> Result<Self>

Examples found in repository?
examples/06_aa_entry_stream_path_list.rs (lines 15-20)
7fn main() -> Result<(), Box<dyn std::error::Error>> {
8    let artifact_dir = artifact_dir("aa-entry-stream");
9    fs::create_dir_all(artifact_dir.join("nested"))?;
10    fs::write(
11        artifact_dir.join("nested").join("example.txt"),
12        b"entry stream",
13    )?;
14
15    let path_list = PathList::from_directory_contents(
16        &path_string(&artifact_dir),
17        None,
18        ArchiveFlags::empty(),
19        0,
20    )?;
21    let paths = path_list.paths()?;
22    assert!(paths.iter().any(|path| path.ends_with("example.txt")));
23    println!("paths={paths:?}");
24    println!("✅ AppleArchive entry/path-list APIs OK");
25    Ok(())
26}
Source

pub fn from_path(dir: &str, path: &str) -> Result<Self>

Source

pub fn first_node(&self) -> Option<u64>

Source

pub fn next_node(&self, node: u64) -> Option<u64>

Source

pub fn node_path(&self, node: u64) -> Result<String>

Source

pub fn paths(&self) -> Result<Vec<String>>

Examples found in repository?
examples/06_aa_entry_stream_path_list.rs (line 21)
7fn main() -> Result<(), Box<dyn std::error::Error>> {
8    let artifact_dir = artifact_dir("aa-entry-stream");
9    fs::create_dir_all(artifact_dir.join("nested"))?;
10    fs::write(
11        artifact_dir.join("nested").join("example.txt"),
12        b"entry stream",
13    )?;
14
15    let path_list = PathList::from_directory_contents(
16        &path_string(&artifact_dir),
17        None,
18        ArchiveFlags::empty(),
19        0,
20    )?;
21    let paths = path_list.paths()?;
22    assert!(paths.iter().any(|path| path.ends_with("example.txt")));
23    println!("paths={paths:?}");
24    println!("✅ AppleArchive entry/path-list APIs OK");
25    Ok(())
26}

Trait Implementations§

Source§

impl Debug for PathList

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for PathList

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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> 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, 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.