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

a FileAttributeMatcher

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.

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.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.