pub enum StoreError {
NotFound {
path: String,
},
Unreachable {
path: String,
reason: String,
},
Denied {
path: String,
reason: String,
},
Backend {
path: String,
reason: String,
},
Layout {
reason: String,
},
Conflict {
path: String,
reason: String,
},
Unsupported {
operation: String,
reason: String,
},
}Expand description
What a SecretStore can fail with.
Every variant that names a location names the rendered path, not the CredentialRef, because
the path is what an operator needs in order to go and look — and because a reference renders
differently under each Layout, so quoting the address alone would send them to the wrong
place. Layout is the exception, and only because there is no rendered path in
that case: the path was the input, and the layout’s own message quotes it. None of them carries
a value: a StoreError is safe to log.
Variants§
NotFound
The backend answered, and there is nothing stored at that path.
Distinct from Unreachable on purpose: this one means “this tenant has
not connected that integration”, and the other means “we cannot say”.
Unreachable
The backend could not be reached, or did not answer in a usable way.
A retry may succeed. Never present this to a caller as “not configured”.
Fields
Denied
The backend answered and refused: the store’s own credentials are missing, expired or not authorised for that path.
Backend
The backend answered with something this client cannot interpret — a response shape it does not recognise, or a status it has no meaning for.
Separate from Unreachable because retrying will not help.
Layout
The configured Layout could not recover the address from a path.
A custom layout is allowed to refuse a path it cannot spell; that is stated in Layout’s
contract as the alternative to guessing. Layout::render is infallible, so
Layout::parse is the only place a layout can refuse, and MemoryStore::reference and
VaultStore::reference are the two calls that raise this. That pairing is deliberate: a
variant no store can construct is a promise that does not hold, and this one used to be
exactly that (C-149).
Conflict
A checked mutation conflicts with the state already stored at its address.
Fields
Unsupported
The backend cannot provide a requested guarantee.
Implementations§
Source§impl StoreError
impl StoreError
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Whether this is NotFound — the “this tenant has not connected it” case.
A named predicate because the distinction is the reason the error type exists, and because a caller reaching for it should not have to spell out a match over a growing enum.
Trait Implementations§
Source§impl Clone for StoreError
impl Clone for StoreError
Source§fn clone(&self) -> StoreError
fn clone(&self) -> StoreError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StoreError
impl Debug for StoreError
Source§impl Display for StoreError
impl Display for StoreError
impl Eq for StoreError
Source§impl Error for StoreError
impl Error for StoreError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for StoreError
impl PartialEq for StoreError
impl StructuralPartialEq for StoreError
Auto Trait Implementations§
impl Freeze for StoreError
impl RefUnwindSafe for StoreError
impl Send for StoreError
impl Sync for StoreError
impl Unpin for StoreError
impl UnsafeUnpin for StoreError
impl UnwindSafe for StoreError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.