Skip to main content

SingletonHandoff

Trait SingletonHandoff 

Source
pub trait SingletonHandoff: Send + 'static {
    // Required methods
    fn prepare_handoff<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = HandoffState> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn assume<'life0, 'async_trait>(
        &'life0 mut self,
        prior: Option<HandoffState>,
        fence: FenceToken,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Hook for migrating external state (e.g. a broker session, a lease, an open file) when the singleton moves between nodes (FR-7c).

prepare_handoff runs on the outgoing node when it enters HandingOver; assume runs on the incoming node when it becomes Active(here), receiving the prior state (if any was captured locally) and the freshly-bumped FenceToken.

Required Methods§

Source

fn prepare_handoff<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = HandoffState> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn assume<'life0, 'async_trait>( &'life0 mut self, prior: Option<HandoffState>, fence: FenceToken, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§