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§

source§

impl<H, N, I> ChangeHeaderKey<H, N, I>

source

pub fn swap_on_seal( original: KeyingScheme<H, I>, new: KeyingScheme<N, I> ) -> Self

Trait Implementations§

source§

impl<H, N, I> Into<Arc<dyn KeySource>> for ChangeHeaderKey<H, N, I>where H: HeaderScheme + 'static, N: HeaderScheme + 'static, I: InternalScheme + 'static,

source§

fn into(self) -> Key

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

Auto Trait Implementations§

§

impl<H, N, I> RefUnwindSafe for ChangeHeaderKey<H, N, I>where H: RefUnwindSafe, I: RefUnwindSafe, N: RefUnwindSafe,

§

impl<H, N, I> Send for ChangeHeaderKey<H, N, I>where H: Send + Sync, I: Send, N: Send + Sync,

§

impl<H, N, I> Sync for ChangeHeaderKey<H, N, I>where H: Send + Sync, I: Sync, N: Send + Sync,

§

impl<H, N, I> Unpin for ChangeHeaderKey<H, N, I>where I: Unpin,

§

impl<H, N, I> UnwindSafe for ChangeHeaderKey<H, N, I>where H: RefUnwindSafe, I: UnwindSafe, N: RefUnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> KeySource for Twhere T: 'static + Scheme,