pub struct SecretStore { /* private fields */ }Implementations§
Source§impl SecretStore
impl SecretStore
pub fn for_app(app_id: &str) -> SecretStore
pub fn memory(app_id: &str) -> SecretStore
pub fn with_backend( app_id: &str, backend: Arc<dyn SecretBackend>, ) -> SecretStore
Sourcepub fn seal_blocking(
&self,
key: &str,
value: &[u8],
options: PutOptions,
) -> Result<Option<String>, SecretError>
pub fn seal_blocking( &self, key: &str, value: &[u8], options: PutOptions, ) -> Result<Option<String>, SecretError>
Start an immutable write, returning its key only after durable ownership. None means
pending: retry the same namespace and bytes on a later turn.
Sourcepub fn pending() -> bool
pub fn pending() -> bool
Whether page ownership has asynchronous operations awaiting a retry; native and host-injected synchronous stores never stage operations here.
pub fn app_id(&self) -> &str
pub fn protection(&self) -> Protection
pub async fn get(&self, key: &str) -> Result<Option<Secret>, SecretError>
pub async fn put( &self, key: &str, value: &[u8], options: PutOptions, ) -> Result<(), SecretError>
pub async fn delete(&self, key: &str) -> Result<(), SecretError>
Sourcepub fn get_blocking(&self, key: &str) -> Result<Option<Secret>, SecretError>
pub fn get_blocking(&self, key: &str) -> Result<Option<Secret>, SecretError>
get, blocking the calling thread. Desktop code only.
§Errors
As get, and Feature::Blocking unsupported on the web.
Sourcepub fn put_blocking(
&self,
key: &str,
value: &[u8],
options: PutOptions,
) -> Result<(), SecretError>
pub fn put_blocking( &self, key: &str, value: &[u8], options: PutOptions, ) -> Result<(), SecretError>
put, blocking the calling thread. Desktop code only.
§Errors
As put, and Feature::Blocking unsupported on the web.
Sourcepub fn delete_blocking(&self, key: &str) -> Result<(), SecretError>
pub fn delete_blocking(&self, key: &str) -> Result<(), SecretError>
delete, blocking the calling thread. Desktop code
only.
§Errors
As delete, and Feature::Blocking unsupported on the web.
Sourcepub fn probe_blocking(&self) -> Result<(), SecretError>
pub fn probe_blocking(&self) -> Result<(), SecretError>
Whether the store answers on this session, blocking the calling thread. The web store always answers.
Sourcepub fn entries_blocking(&self) -> Result<Vec<(String, String)>, SecretError>
pub fn entries_blocking(&self) -> Result<Vec<(String, String)>, SecretError>
Every entry the platform’s store holds on this machine, as (app, key), whether or not
this process may read its secret. The store’s own app does not narrow the answer: the
platform’s store is shared, and a migration that moves its entries into a workspace vault
walks it for every app. Nothing here reads a secret.
§Errors
The store could not be asked. On the web there is no such store to walk: the answer is none.
Source§impl SecretStore
impl SecretStore
Sourcepub fn item(&self, purpose: &str, item: &str) -> ItemSecret
pub fn item(&self, purpose: &str, item: &str) -> ItemSecret
The secret one item of a document needs for purpose: a database
profile’s password, a connection’s SSH passphrase, an account’s
one-time-password seed. The document names the item by its id and
never holds the secret; the secret stays in this store on this
device.
purpose is one of the app’s own fixed names and contains no /;
item is the item’s id in the document.
Trait Implementations§
Source§impl Clone for SecretStore
impl Clone for SecretStore
Source§fn clone(&self) -> SecretStore
fn clone(&self) -> SecretStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SecretStore
impl !UnwindSafe for SecretStore
impl Forget for SecretStore
impl Freeze for SecretStorewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<dyn SecretBackend> is !null: Freeze,
PhantomData<ArcInner<dyn SecretBackend>>: Freeze,
impl Move for SecretStore
impl Send for SecretStore
impl Sync for SecretStore
impl Unpin for SecretStore
impl UnsafeUnpin for SecretStorewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn SecretBackend> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SecretBackend>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more