RouterDestination

Trait RouterDestination 

Source
pub trait RouterDestination: Send + Sync {
    // Required methods
    fn exec_component(&self);
    fn shard_id(&self) -> &'static str;

    // Provided method
    fn life_cycle(&self) -> ShardStateLifeCycle { ... }
}
Expand description

A navigation destination produced automatically by the #[shard] macro.

You should not manually implement this trait. Each annotated shard function creates a *Destination struct that implements RouterDestination.

Required Methods§

Source

fn exec_component(&self)

Execute the component associated with this destination.

Source

fn shard_id(&self) -> &'static str

Stable shard identifier used for state registry lookups / cleanup.

Provided Methods§

Source

fn life_cycle(&self) -> ShardStateLifeCycle

Lifecycle policy for the shard state tied to this destination.

Default is Shard, which means the associated shard state will be removed from the registry when this destination is popped. Override in generated implementations to persist for the whole app.

Implementors§