Struct gio::FileAttributeMatcher [−][src]
pub struct FileAttributeMatcher(_);
Expand description
Determines if a string matches a file attribute.
Implementations
Creates a new file attribute matcher, which matches attributes
against a given string. GFileAttributeMatchers
are reference
counted structures, and are created with a reference count of 1. If
the number of references falls to 0, the FileAttributeMatcher
is
automatically destroyed.
The attributes
string should be formatted with specific keys separated
from namespaces with a double colon. Several “namespace::key” strings may be
concatenated with a single comma (e.g. “standard::type,standard::is-hidden”).
The wildcard “” may be used to match all keys and namespaces, or
“namespace::” will match all keys in a given namespace.
Examples of file attribute matcher strings and results
"*"
: matches all attributes."standard::is-hidden"
: matches only the key is-hidden in the standard namespace."standard::type,unix::*"
: matches the type key in the standard namespace and all keys in the unix namespace.
attributes
an attribute string to match.
Returns
Checks if the matcher will match all of the keys in a given namespace.
This will always return true
if a wildcard character is in use (e.g. if
matcher was created with “standard::” and ns
is “standard”, or if matcher was created
using “” and namespace is anything.)
TODO: this is awkwardly worded.
ns
a string containing a file attribute namespace.
Returns
true
if the matcher matches all of the entries
in the given ns
, false
otherwise.
pub fn subtract(
&self,
subtract: Option<&FileAttributeMatcher>
) -> Option<FileAttributeMatcher>
pub fn subtract(
&self,
subtract: Option<&FileAttributeMatcher>
) -> Option<FileAttributeMatcher>
Subtracts all attributes of subtract
from self
and returns
a matcher that supports those attributes.
Note that currently it is not possible to remove a single
attribute when the self
matches the whole namespace - or remove
a namespace or attribute when the matcher matches everything. This
is a limitation of the current implementation, but may be fixed
in the future.
subtract
The matcher to subtract
Returns
A file attribute matcher matching all attributes of
self
that are not matched by subtract
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for FileAttributeMatcher
impl !Send for FileAttributeMatcher
impl !Sync for FileAttributeMatcher
impl Unpin for FileAttributeMatcher
impl UnwindSafe for FileAttributeMatcher
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,