Trait nuts_container::Service

source ·
pub trait Service<B: Backend> {
    type Migration: Migration;

    // Required methods
    fn need_top_id() -> bool;
    fn migration() -> Self::Migration;
}
Expand description

A service running on top of a Container.

A concrete service should implement this trait. Later, such a service can be instantiated with Container::open_service resp. Container::create_service.

Required Associated Types§

source

type Migration: Migration

The migration assiciated with this service.

Required Methods§

source

fn need_top_id() -> bool

Returns true if the service requires a top-id.

If a top-id is required, a top-id is aquired and stored in the header of the container when creating a service-instance.

source

fn migration() -> Self::Migration

Returns the migration assiciated with this service.

Object Safety§

This trait is not object safe.

Implementors§