Skip to main content

Chain

Struct Chain 

Source
pub struct Chain { /* private fields */ }
Expand description

The steps from each earlier format a session can be brought from, in the order they apply.

Implementations§

Source§

impl Chain

Source

pub fn migrate( &self, store: &dyn Store, verify: &Verify<'_>, ) -> Result<(), SessionError>

Brings the session in store to FORMAT through this chain’s steps, when it is in an earlier format one of them starts from; a session already in FORMAT, or with no complete log line, is left alone. The migrated session is checked whole before anything is written: every record reads and its change applies, every image blob a message names loads, and each saved value a step changed (the newest of its key, as a read gives it, and the listed ones of META) decodes when verify knows its type. A value no step changed is left to the restore, which skips one that no longer decodes. Then the session as it was is copied under KEPT and read back, and only then is each changed file and log replaced. Logs, values and files a step does not know are kept byte for byte.

§Errors

SessionError::Format when no step starts from the session’s format, its logs name different formats, or a log names none; io::ErrorKind::AlreadyExists when the store holds a kept copy from this format already, of a migration that did not finish; a step’s or a check’s error; or the store failing. Each but the last is returned before anything is written. SessionError::Changed when a log changed while it was migrated.

Auto Trait Implementations§

§

impl Freeze for Chain

§

impl RefUnwindSafe for Chain

§

impl Send for Chain

§

impl Sync for Chain

§

impl Unpin for Chain

§

impl UnsafeUnpin for Chain

§

impl UnwindSafe for Chain

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more