Skip to main content

MobileObject

Trait MobileObject 

Source
pub trait MobileObject: DistributedObject {
    type Snapshot: WireValue;

    const MOBILITY: Mobility;
    const SNAPSHOT_VERSION: u32;

    // Required methods
    fn freeze(&mut self) -> Result<Self::Snapshot, ActionError>;
    fn restore(
        snapshot: Self::Snapshot,
        context: RestoreContext,
    ) -> Result<Self, ActionError>;
}
Expand description

Logical object state that can be frozen and restored at another Place.

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn freeze(&mut self) -> Result<Self::Snapshot, ActionError>

Produces a versioned logical snapshot while runtime admission is closed.

§Errors

Returns ActionError when logical state cannot be snapshotted.

Source

fn restore( snapshot: Self::Snapshot, context: RestoreContext, ) -> Result<Self, ActionError>

Restores logical state and rebuilds destination-local resources.

§Errors

Returns ActionError when the snapshot is invalid or a required destination-local resource cannot be reconstructed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§