pub struct PathList { /* private fields */ }Expand description
Wraps an AAPathList handle.
Implementations§
Source§impl PathList
impl PathList
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>
Wraps AAPathListCreateWithDirectoryContents.
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}Sourcepub fn first_node(&self) -> Option<u64>
pub fn first_node(&self) -> Option<u64>
Wraps AAPathListNodeGetPath.
Sourcepub fn paths(&self) -> Result<Vec<String>>
pub fn paths(&self) -> Result<Vec<String>>
Wraps iterative AAPathListNode* traversal.
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 !Send for PathList
impl !Sync for PathList
impl Freeze for PathList
impl RefUnwindSafe 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