pub struct PathList { /* private fields */ }Implementations§
Source§impl PathList
impl PathList
pub const END_NODE: u64 = u64::MAX
Sourcepub fn from_directory_contents(
dir: &str,
path: Option<&str>,
flags: ArchiveFlags,
n_threads: i32,
) -> Result<Self>
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}pub fn from_path(dir: &str, path: &str) -> Result<Self>
pub fn first_node(&self) -> Option<u64>
pub fn next_node(&self, node: u64) -> Option<u64>
pub fn node_path(&self, node: u64) -> Result<String>
Sourcepub fn paths(&self) -> Result<Vec<String>>
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§
Auto Trait Implementations§
impl Freeze for PathList
impl RefUnwindSafe for PathList
impl !Send for PathList
impl !Sync for PathList
impl Unpin for PathList
impl UnsafeUnpin for PathList
impl UnwindSafe for PathList
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