pub trait CollectionExtManual: 'static {
// Required methods
fn search<P: FnOnce(Result<Vec<Item>, Error>) + 'static>(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
flags: SearchFlags,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
);
fn search_future(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
flags: SearchFlags,
) -> Pin<Box_<dyn Future<Output = Result<Vec<Item>, Error>> + 'static>>;
fn search_sync(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
flags: SearchFlags,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Vec<Item>, Error>;
fn search_for_dbus_paths<P: FnOnce(Result<Vec<GString>, Error>) + 'static>(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
);
fn search_for_dbus_paths_future(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
) -> Pin<Box_<dyn Future<Output = Result<Vec<GString>, Error>> + 'static>>;
fn search_for_dbus_paths_sync(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Vec<GString>, Error>;
}
Required Methods§
Sourcefn search<P: FnOnce(Result<Vec<Item>, Error>) + 'static>(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
flags: SearchFlags,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn search<P: FnOnce(Result<Vec<Item>, Error>) + 'static>( &self, schema: Option<&Schema>, attributes: HashMap<&str, &str>, flags: SearchFlags, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Search for items matching the @attributes in the @collection. The @attributes should be a table of string keys and string values.
If SearchFlags::ALL
is set in @flags, then all the items matching the
search will be returned. Otherwise only the first item will be returned.
This is almost always the unlocked item that was most recently stored.
If SearchFlags::UNLOCK
is set in @flags, then items will be unlocked
if necessary. In either case, locked and unlocked items will match the
search and be returned. If the unlock fails, the search does not fail.
If SearchFlags::LOAD_SECRETS
is set in @flags, then the items will have
their secret values loaded and available via ItemExt::secret()
.
This function returns immediately and completes asynchronously.
§schema
the schema for the attributes
§attributes
search for items matching these attributes
§flags
search option flags
§cancellable
optional cancellation object
§callback
called when the operation completes
fn search_future( &self, schema: Option<&Schema>, attributes: HashMap<&str, &str>, flags: SearchFlags, ) -> Pin<Box_<dyn Future<Output = Result<Vec<Item>, Error>> + 'static>>
Sourcefn search_sync(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
flags: SearchFlags,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Vec<Item>, Error>
fn search_sync( &self, schema: Option<&Schema>, attributes: HashMap<&str, &str>, flags: SearchFlags, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Vec<Item>, Error>
Search for items matching the @attributes in the @collection. The @attributes should be a table of string keys and string values.
If SearchFlags::ALL
is set in @flags, then all the items matching the
search will be returned. Otherwise only the first item will be returned.
This is almost always the unlocked item that was most recently stored.
If SearchFlags::UNLOCK
is set in @flags, then items will be unlocked
if necessary. In either case, locked and unlocked items will match the
search and be returned. If the unlock fails, the search does not fail.
If SearchFlags::LOAD_SECRETS
is set in @flags, then the items will have
their secret values loaded and available via ItemExt::secret()
.
This function may block indefinitely. Use the asynchronous version in user interface threads.
§schema
the schema for the attributes
§attributes
search for items matching these attributes
§flags
search option flags
§cancellable
optional cancellation object
§Returns
a list of items that matched the search
Sourcefn search_for_dbus_paths<P: FnOnce(Result<Vec<GString>, Error>) + 'static>(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
fn search_for_dbus_paths<P: FnOnce(Result<Vec<GString>, Error>) + 'static>( &self, schema: Option<&Schema>, attributes: HashMap<&str, &str>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
Search for items in @self matching the @attributes, and return their DBus object paths.
Only the specified collection is searched. The @attributes should be a table of string keys and string values.
This function returns immediately and completes asynchronously.
When your callback is called use Collection::search_for_dbus_paths_finish()
to get the results of this function. Only the DBus object paths of the
items will be returned. If you would like Item
objects to be returned
instead, then use the search()
function.
§schema
the schema for the attributes
§attributes
search for items matching these attributes
§cancellable
optional cancellation object
§callback
called when the operation completes
fn search_for_dbus_paths_future( &self, schema: Option<&Schema>, attributes: HashMap<&str, &str>, ) -> Pin<Box_<dyn Future<Output = Result<Vec<GString>, Error>> + 'static>>
Sourcefn search_for_dbus_paths_sync(
&self,
schema: Option<&Schema>,
attributes: HashMap<&str, &str>,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Vec<GString>, Error>
fn search_for_dbus_paths_sync( &self, schema: Option<&Schema>, attributes: HashMap<&str, &str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Vec<GString>, Error>
Search for items matching the @attributes in @self, and return their DBus object paths.
The @attributes should be a table of string keys and string values.
This function may block indefinitely. Use the asynchronous version in user interface threads.
DBus object paths of the items will be returned. If you would to have
Item
objects to be returned instead, then use the
search_sync()
function.
§schema
the schema for the attributes
§attributes
search for items matching these attributes
§cancellable
optional cancellation object
§Returns
an array of DBus object paths for matching items.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.