Skip to main content

Maintenance

Struct Maintenance 

Source
pub struct Maintenance<M: Memory = DefaultMemoryImpl> { /* private fields */ }
Expand description

Exclusive handle to a durably frozen source, before any target allocation/copy. Dropping this handle leaves maintenance active. Ordinary reads/writes remain closed. Host adapters own authorization and endpoint exposure.

Implementations§

Source§

impl<M: Memory> Maintenance<M>

Source

pub fn begin_copy( self, memory: RuntimeMemory<M>, source: Schema, target: Schema, incarnation: [u8; 16], ) -> Result<SchemaCopy<M>, Error>

Bind a fresh target allocation to this frozen source and initialize copying. The host supplies a fresh nonzero target incarnation, distinct from the source. The schemas must contain the same named entities, each retaining its primary key declaration and managed timestamp roles. References validate only after all entities are copied, including unchanged entities. All values and target indexes use ordinary codecs and shared batch validation.

§Errors

Refuses unsupported shapes, wrong schemas/identity or nonempty target memory before mutation. Initial supplier growth may also refuse.

§Panics

Failures after target initialization trap; never catch and continue.

Source§

impl<M: Memory> Maintenance<M>

Source

pub fn resume( memory: RuntimeMemory<M>, expected: &SchemaTransition, ) -> Result<Self, Error>

Reopen a frozen source only for the exact supported transition.

§Errors

Refuses live data, different identities, unsupported phases and corrupt frames intact.

§Panics

Supplier corruption traps without repair, as for ordinary database admission.

Source

pub const fn transition(&self) -> &SchemaTransition

Inspect the admitted transformation identity.

Source

pub const fn incarnation(&self) -> [u8; 16]

Original database incarnation, preserved by cancellation.

Source

pub fn source_page<E: Entity>( &self, source: &Schema, after: Option<&QueryCursor>, limit: usize, bytes: usize, ) -> Result<QueryPage<E>, Error>

Read frozen source entities in ascending primary-key order through their explicitly supplied compiled source schema and decoder. Limits are 1..=32 candidates and 1..=128 KiB of encoded output per call. Only next == None establishes completion; a byte-limited page retries its unreturned row. Cursors bind the transition, database, entity and source revision. Cancelling, editing that entity and refreezing invalidates earlier cursors. These are caller-controlled read positions, not trusted migration checkpoints.

§Errors

Refuses incompatible source schemas/decoders, invalid limits/cursors and corrupt rows or revisions. An individually oversized row returns RowTooLarge.

§Panics

Supplier corruption traps without repair.

Source

pub fn cancel(self)

Cancel before target allocation/copy and restore the original live manifest. Reopening then requires an executable compatible with the source contract. A later trap in this IC message restores the frozen state.

§Panics

Supplier mutation failures trap the enclosing IC message.

Auto Trait Implementations§

§

impl<M = Rc<RefCell<Vec<u8>>>> !RefUnwindSafe for Maintenance<M>

§

impl<M = Rc<RefCell<Vec<u8>>>> !Send for Maintenance<M>

§

impl<M = Rc<RefCell<Vec<u8>>>> !Sync for Maintenance<M>

§

impl<M = Rc<RefCell<Vec<u8>>>> !UnwindSafe for Maintenance<M>

§

impl<M> Forget for Maintenance<M>

§

impl<M> Freeze for Maintenance<M>
where StableBTreeMap<StoreKey, Vec<u8>, M>: Freeze,

§

impl<M> Move for Maintenance<M>

§

impl<M> Unpin for Maintenance<M>
where StableBTreeMap<StoreKey, Vec<u8>, M>: Unpin,

§

impl<M> UnsafeUnpin for Maintenance<M>
where StableBTreeMap<StoreKey, Vec<u8>, M>: UnsafeUnpin,

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.