Skip to main content

UnlockOutcome

Enum UnlockOutcome 

Source
pub enum UnlockOutcome {
    Unlocked {
        credential: String,
        kind: CredentialKind,
        slot_index: usize,
        filename: Option<String>,
        plaintext_size: u64,
    },
    Locked,
}
Expand description

解锁尝试的结果。

Variants§

§

Unlocked

某个凭据成功解开。

Fields

§credential: String

命中的凭据名称。

§kind: CredentialKind

凭据类型。

§slot_index: usize

命中的 slot 序号。

§filename: Option<String>

解出的原始文件名(若文件加密了文件名且 TLV 可读)。

§plaintext_size: u64

明文大小。

§

Locked

是 .omy 文件,但当前所有凭据都打不开。

注意:这不代表文件损坏或密码错误——它可能属于另一个密码集。 UI 应表述为「不属于当前密码」而非「密码错误」。

Implementations§

Source§

impl UnlockOutcome

Source

pub const fn is_unlocked(&self) -> bool

是否成功解锁。

Trait Implementations§

Source§

impl Debug for UnlockOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.