pub struct FileAttributeMatcher { /* private fields */ }
Expand description
Determines if a string matches a file attribute.
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
Source§impl FileAttributeMatcher
impl FileAttributeMatcher
Sourcepub fn as_ptr(&self) -> *mut GFileAttributeMatcher
pub fn as_ptr(&self) -> *mut GFileAttributeMatcher
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut GFileAttributeMatcher) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GFileAttributeMatcher) -> &Self
Borrows the underlying C value.
Source§impl FileAttributeMatcher
impl FileAttributeMatcher
Sourcepub fn new(attributes: &str) -> FileAttributeMatcher
pub fn new(attributes: &str) -> FileAttributeMatcher
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 #GFileAttributeMatcher 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
a #GFileAttributeMatcher
Sourcepub fn enumerate_namespace(&self, ns: &str) -> bool
pub fn enumerate_namespace(&self, ns: &str) -> bool
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.
Sourcepub fn matches_only(&self, attribute: &str) -> bool
pub fn matches_only(&self, attribute: &str) -> bool
Sourcepub 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
Sourcepub fn to_str(&self) -> GString
pub fn to_str(&self) -> GString
Prints what the matcher is matching against. The format will be equal to the format passed to g_file_attribute_matcher_new(). The output however, might not be identical, as the matcher may decide to use a different order or omit needless parts.
§Returns
a string describing the attributes the matcher matches
against or None
if @self was None
.
Trait Implementations§
Source§impl Clone for FileAttributeMatcher
impl Clone for FileAttributeMatcher
Source§impl Debug for FileAttributeMatcher
impl Debug for FileAttributeMatcher
Source§impl Display for FileAttributeMatcher
impl Display for FileAttributeMatcher
Source§impl From<FileAttributeMatcher> for Value
impl From<FileAttributeMatcher> for Value
Source§fn from(s: FileAttributeMatcher) -> Self
fn from(s: FileAttributeMatcher) -> Self
Source§impl HasParamSpec for FileAttributeMatcher
impl HasParamSpec for FileAttributeMatcher
type ParamSpec = ParamSpecBoxed
Source§type SetValue = FileAttributeMatcher
type SetValue = FileAttributeMatcher
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, FileAttributeMatcher>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for FileAttributeMatcher
impl Hash for FileAttributeMatcher
Source§impl IntoIterator for FileAttributeMatcher
impl IntoIterator for FileAttributeMatcher
Source§impl Ord for FileAttributeMatcher
impl Ord for FileAttributeMatcher
Source§fn cmp(&self, other: &FileAttributeMatcher) -> Ordering
fn cmp(&self, other: &FileAttributeMatcher) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FileAttributeMatcher
impl PartialEq for FileAttributeMatcher
Source§impl PartialOrd for FileAttributeMatcher
impl PartialOrd for FileAttributeMatcher
Source§impl StaticType for FileAttributeMatcher
impl StaticType for FileAttributeMatcher
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for FileAttributeMatcher
impl StructuralPartialEq for FileAttributeMatcher
Auto Trait Implementations§
impl Freeze for FileAttributeMatcher
impl RefUnwindSafe for FileAttributeMatcher
impl !Send for FileAttributeMatcher
impl !Sync for FileAttributeMatcher
impl Unpin for FileAttributeMatcher
impl UnwindSafe for FileAttributeMatcher
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)