pub trait ItemExt: IsA<Item> + Sealed + 'static {
Show 19 methods // Provided methods fn delete<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P ) { ... } fn delete_future( &self ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... } fn delete_sync( &self, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error> { ... } fn flags(&self) -> ItemFlags { ... } fn is_locked(&self) -> bool { ... } fn schema_name(&self) -> Option<GString> { ... } fn secret(&self) -> Option<Value> { ... } fn service(&self) -> Service { ... } fn load_secret<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P ) { ... } fn load_secret_future( &self ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... } fn load_secret_sync( &self, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error> { ... } fn refresh(&self) { ... } fn set_label<P: FnOnce(Result<(), Error>) + 'static>( &self, label: &str, cancellable: Option<&impl IsA<Cancellable>>, callback: P ) { ... } fn set_label_future( &self, label: &str ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... } fn set_label_sync( &self, label: &str, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error> { ... } fn set_secret<P: FnOnce(Result<(), Error>) + 'static>( &self, value: &Value, cancellable: Option<&impl IsA<Cancellable>>, callback: P ) { ... } fn set_secret_future( &self, value: &Value ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... } fn set_secret_sync( &self, value: &Value, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error> { ... } fn connect_locked_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Item methods.

§Implementors

Item

Provided Methods§

source

fn delete<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Delete this item.

This method returns immediately and completes asynchronously. The secret service may prompt the user. ServiceExt::prompt() will be used to handle any prompts that show up.

§cancellable

optional cancellation object

§callback

called when the operation completes

source

fn delete_future( &self ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source

fn delete_sync( &self, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error>

Delete this secret item.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. ServiceExt::prompt() will be used to handle any prompts that show up.

§cancellable

optional cancellation object

§Returns

whether the item was successfully deleted or not

source

fn flags(&self) -> ItemFlags

Get the flags representing what features of the #SecretItem proxy have been initialized.

Use load_secret() to initialize further features and change the flags.

§Returns

the flags for features initialized

source

fn is_locked(&self) -> bool

Get whether the item is locked or not.

Depending on the secret service an item may not be able to be locked independently from the collection that it is in.

§Returns

whether the item is locked or not

source

fn schema_name(&self) -> Option<GString>

Gets the name of the schema that this item was stored with. This is also available at the xdg:schema attribute.

§Returns

the schema name

source

fn secret(&self) -> Option<Value>

Get the secret value of this item.

If this item is locked or the secret has not yet been loaded then this will return None.

To load the secret call the load_secret() method.

§Returns

the secret value which should be released with Value::unref(), or None

source

fn service(&self) -> Service

Get the Secret Service object that this item was created with.

§Returns

the Secret Service object

source

fn load_secret<P: FnOnce(Result<(), Error>) + 'static>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Load the secret value of this item.

Each item has a single secret which might be a password or some other secret binary value.

This function will fail if the secret item is locked.

This function returns immediately and completes asynchronously.

§cancellable

optional cancellation object

§callback

called when the operation completes

source

fn load_secret_future( &self ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source

fn load_secret_sync( &self, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error>

Load the secret value of this item.

Each item has a single secret which might be a password or some other secret binary value.

This function may block indefinitely. Use the asynchronous version in user interface threads.

§cancellable

optional cancellation object

§Returns

whether the secret item successfully loaded or not

source

fn refresh(&self)

Refresh the properties on this item.

This fires off a request to refresh, and the properties will be updated later.

Calling this method is not normally necessary, as the secret service will notify the client when properties change.

source

fn set_label<P: FnOnce(Result<(), Error>) + 'static>( &self, label: &str, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Set the label of this item.

This function returns immediately and completes asynchronously.

§label

a new label

§cancellable

optional cancellation object

§callback

called when the operation completes

source

fn set_label_future( &self, label: &str ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source

fn set_label_sync( &self, label: &str, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error>

Set the label of this item.

This function may block indefinitely. Use the asynchronous version in user interface threads.

§label

a new label

§cancellable

optional cancellation object

§Returns

whether the change was successful or not

source

fn set_secret<P: FnOnce(Result<(), Error>) + 'static>( &self, value: &Value, cancellable: Option<&impl IsA<Cancellable>>, callback: P )

Set the secret value of this item.

Each item has a single secret which might be a password or some other secret binary value.

This function returns immediately and completes asynchronously.

§value

a new secret value

§cancellable

optional cancellation object

§callback

called when the operation completes

source

fn set_secret_future( &self, value: &Value ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

source

fn set_secret_sync( &self, value: &Value, cancellable: Option<&impl IsA<Cancellable>> ) -> Result<(), Error>

Set the secret value of this item.

Each item has a single secret which might be a password or some other secret binary value.

This function may block indefinitely. Use the asynchronous version in user interface threads.

§value

a new secret value

§cancellable

optional cancellation object

§Returns

whether the change was successful or not

source

fn connect_locked_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Item>> ItemExt for O