[]Struct gio::FileAttributeMatcher

pub struct FileAttributeMatcher(_);

Determines if a string matches a file attribute.

Methods

impl FileAttributeMatcher[src]

pub fn new(attributes: &str) -> FileAttributeMatcher[src]

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 attribute 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 FileAttributeMatcher

pub fn enumerate_namespace(&self, ns: &str) -> bool[src]

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 matches(&self, attribute: &str) -> bool[src]

Checks if an attribute will be matched by an attribute matcher. If the matcher was created with the "*" matching string, this function will always return true.

attribute

a file attribute key.

Returns

true if attribute matches self. false otherwise.

pub fn matches_only(&self, attribute: &str) -> bool[src]

Checks if a attribute matcher only matches a given attribute. Always returns false if "*" was used when creating the matcher.

attribute

a file attribute key.

Returns

true if the matcher only matches attribute. false otherwise.

pub fn subtract(
    &self,
    subtract: Option<&FileAttributeMatcher>
) -> Option<FileAttributeMatcher>
[src]

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

impl Clone for FileAttributeMatcher

impl Debug for FileAttributeMatcher[src]

impl Display for FileAttributeMatcher[src]

impl Eq for FileAttributeMatcher[src]

impl Hash for FileAttributeMatcher[src]

impl IntoIterator for FileAttributeMatcher[src]

type Item = GString

The type of the elements being iterated over.

type IntoIter = FileAttributematcherIter

Which kind of iterator are we turning this into?

impl Ord for FileAttributeMatcher[src]

impl PartialEq<FileAttributeMatcher> for FileAttributeMatcher[src]

impl PartialOrd<FileAttributeMatcher> for FileAttributeMatcher[src]

impl StaticType for FileAttributeMatcher

impl StructuralEq for FileAttributeMatcher[src]

impl StructuralPartialEq for FileAttributeMatcher[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.