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 { ... }
}
Provided Methods§
Sourcefn delete<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
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
fn delete_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn delete_sync(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
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
Sourcefn flags(&self) -> ItemFlags
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
Sourcefn is_locked(&self) -> bool
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
Sourcefn schema_name(&self) -> Option<GString>
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
Sourcefn secret(&self) -> Option<Value>
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
Sourcefn load_secret<P: FnOnce(Result<(), Error>) + 'static>(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
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
fn load_secret_future( &self, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn load_secret_sync(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
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
Sourcefn refresh(&self)
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.
Sourcefn set_label<P: FnOnce(Result<(), Error>) + 'static>(
&self,
label: &str,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
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>>
Sourcefn set_label_sync(
&self,
label: &str,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
fn set_label_sync( &self, label: &str, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
Sourcefn set_secret<P: FnOnce(Result<(), Error>) + 'static>(
&self,
value: &Value,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
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
fn set_secret_future( &self, value: &Value, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>
Sourcefn set_secret_sync(
&self,
value: &Value,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<(), Error>
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
fn connect_locked_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
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.