#[non_exhaustive]pub enum FileStoreError {
InvalidNamespace,
Io {
path: PathBuf,
source: Error,
},
StoreKey(StoreKeyError),
WrongStoreKey(PathBuf),
KeyCheckUnverifiable(PathBuf),
InUse(PathBuf),
Closed(PathBuf),
RecordKeyUnreadable(String),
RootsOverlap {
mls_root: PathBuf,
state_root: PathBuf,
on_this_volume: bool,
},
StateWithoutIdentity {
state: PathBuf,
mls_root: PathBuf,
},
ForeignState {
state: PathBuf,
mls_root: PathBuf,
},
}Expand description
Why a built-in file store could not be opened, or could not answer a question about its directory.
Opening and the probes are the only steps with their own error type: a record operation reports through the error type of the trait the store implements.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidNamespace
The namespace is not the output of account_storage_namespace.
Io
The store directory could not be created or read.
StoreKey(StoreKeyError)
The store key provider did not produce a key.
WrongStoreKey(PathBuf)
The store key does not open this store’s records.
Nothing was read, changed or deleted. The usual cause is the operator supplying a different key than the one the store was created with.
KeyCheckUnverifiable(PathBuf)
The key check file does not open, and the store holds no record that could prove the key either way.
Nothing was read, changed or deleted. Either the key is wrong or the check file is damaged, and an empty store cannot tell the two apart. With nothing sealed to lose, removing the check file named here lets the next open start the store afresh under the key offered.
InUse(PathBuf)
Another store already has this directory open, in this process or in another one.
Nothing was read or changed. Two stores over one directory would diverge the MLS state, so the second is refused rather than guarded.
Closed(PathBuf)
The store was closed, and holds its directory no longer.
RecordKeyUnreadable(String)
The MLS store could not say whether it holds the key that seals protocol state.
Nothing was changed. This is a read that failed, not a key that is
missing or damaged: those are answers, and are reported as
SealedState.
RootsOverlap
FileStorePair::open was given one directory for both roots, or
one inside the other.
The MLS root holds the identity and must survive the removal of the
state root, which is scoped to the installation. When
on_this_volume is set, the roots are spelled apart and are one
directory only on this volume (one that folds case), which shows only
once both exist: the stores’ directories were created then, and no
record was written.
Fields
StateWithoutIdentity
The protocol-state account directory holds records and the MLS root holds no identity for the account.
Nothing was created. Opening would mint a new identity (a new address) whose record key cannot unseal those records, and the first restore would delete the ones it read: a deployment moving onto the file stores with a kept state root, or one whose MLS root was lost.
ForeignState
The protocol-state account directory belongs to another MLS store: it is bound to another one, or its sealed records open under no record key this one holds.
No record was changed. Handing the pair to an engine would delete the queued and parked messages its restore reads.
Trait Implementations§
Source§impl Debug for FileStoreError
impl Debug for FileStoreError
Source§impl Display for FileStoreError
impl Display for FileStoreError
Source§impl Error for FileStoreError
impl Error for FileStoreError
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 From<StoreKeyError> for FileStoreError
impl From<StoreKeyError> for FileStoreError
Source§fn from(source: StoreKeyError) -> Self
fn from(source: StoreKeyError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for FileStoreError
impl !UnwindSafe for FileStoreError
impl Freeze for FileStoreError
impl Send for FileStoreError
impl Sync for FileStoreError
impl Unpin for FileStoreError
impl UnsafeUnpin for FileStoreError
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> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);