Skip to main content

SlotPlan

Enum SlotPlan 

Source
pub enum SlotPlan {
    Keep,
    Write(Kek),
    Clear,
}
Expand description

可管理模式下,一个槽位要怎么处理。

不 derive Clone:Kek 刻意没有 Clone(密钥不该被随手复制),调用方 按引用传这个切片即可。

Variants§

§

Keep

保留这个槽位的原有字节。

原样搬运,不需要知道它属于谁——「保住某个槽」与「知道某个槽是 什么」是两件事,前者不需要后者。

§

Write(Kek)

把这个槽位换成给定的 KEK。

§

Clear

清空这个槽位(填随机,目录里应相应记成 Empty)。

Trait Implementations§

Source§

impl Debug for SlotPlan

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.