pub struct ArchiveFilter { /* private fields */ }Expand description
A compiled glob-based entry filter for archive processing.
Patterns are compiled once at construction time. At processing time
passes() is called for each file entry path inside the archive.
§Pattern semantics
*matches any sequence of characters that does not contain/.**matches any sequence of characters including/.?matches any single character except/.[abc]matches one of the listed characters.- A pattern ending with
/is a directory prefix — it matches the directory itself and any path underneath it.
§Filter logic
- If
--onlypatterns are present: the entry path must match at least one pattern, otherwise it is dropped. - If
--excludepatterns are present: if the entry path matches any pattern, it is dropped. - Only file entries are filtered; directory / symlink entries always pass through to preserve archive structure.
Implementations§
Source§impl ArchiveFilter
impl ArchiveFilter
Sourcepub fn new(only: Vec<String>, exclude: Vec<String>) -> Result<Self, String>
pub fn new(only: Vec<String>, exclude: Vec<String>) -> Result<Self, String>
Compile only and exclude pattern lists into an ArchiveFilter.
Returns an error if any pattern contains invalid glob syntax.
Trait Implementations§
Source§impl Clone for ArchiveFilter
impl Clone for ArchiveFilter
Source§fn clone(&self) -> ArchiveFilter
fn clone(&self) -> ArchiveFilter
Returns a duplicate 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 Default for ArchiveFilter
impl Default for ArchiveFilter
Source§fn default() -> ArchiveFilter
fn default() -> ArchiveFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ArchiveFilter
impl RefUnwindSafe for ArchiveFilter
impl Send for ArchiveFilter
impl Sync for ArchiveFilter
impl Unpin for ArchiveFilter
impl UnsafeUnpin for ArchiveFilter
impl UnwindSafe for ArchiveFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more