Skip to main content

RekeyReport

Struct RekeyReport 

Source
pub struct RekeyReport {
    pub changed: usize,
    pub dirs_renamed: usize,
    pub root: PathBuf,
    pub failed: Vec<(PathBuf, String)>,
    pub payload_rewritten: bool,
    pub bytes_rewritten: u64,
}
Expand description

批量改密码的结果。

Fields§

§changed: usize

成功改写的文件数。

§dirs_renamed: usize

重新加密了名字的目录数(含根目录)。

§root: PathBuf

改密码后这棵树的根路径。

根目录名会变:它由 KEK 派生的密钥加密,换密码就得换名字。调用方 必须用这个值,原来手里的路径已经失效——不返回的话,GUI 刷新列表时 会指向一个不存在的目录,表现为「改完密码文件夹不见了」。

§failed: Vec<(PathBuf, String)>

失败的:(路径, 原因)。

逐个记而不是只留一个总的错误码:一棵树里可能只有个别文件出问题 (被别的程序占用、权限不对、单个文件损坏),用户需要知道是哪些 才能去处理,而其余文件已经改好了。

§payload_rewritten: bool

是否换掉了文件密钥(轮换)。

§bytes_rewritten: u64

轮换时重写的明文总字节数。非轮换恒为 0。

Implementations§

Source§

impl RekeyReport

Source

pub const fn is_complete(&self) -> bool

是否整棵树都改成功了。

Trait Implementations§

Source§

impl Debug for RekeyReport

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RekeyReport

Source§

fn default() -> Self

Returns the “default value” for a type. 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.