pub struct ChangeHeaderKey<H, N, I> { /* private fields */ }
Expand description

Change the header key on sealing a tree.

You will need to use this key to open a the tree, then create a commit or reseal to apply the changes.

Examples

use infinitree::{*, crypto::*, fields::VersionedMap, backends::Directory};

let key = ChangeHeaderKey::swap_on_seal(
    UsernamePassword::with_credentials("username".to_string(),
                                       "old_password".to_string()).unwrap(),
    UsernamePassword::with_credentials("username".to_string(),
                                           "new_password".to_string()).unwrap(),
);

let mut tree = Infinitree::<VersionedMap<String, String>>::open(
    Directory::new("/storage").unwrap(),
    key
).unwrap();

tree.reseal();

Implementations

Trait Implementations

Converts this type into the (usually inferred) input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.