Trait sc_service::ChainSpecExtension

source ·
pub trait ChainSpecExtension: Serialize + DeserializeOwned + Clone {
    type Forks: IsForks;

    // Required methods
    fn get<T>(&self) -> Option<&T>
       where T: 'static;
    fn get_any(&self, t: TypeId) -> &(dyn Any + 'static);
    fn get_any_mut(&mut self, t: TypeId) -> &mut (dyn Any + 'static);

    // Provided method
    fn forks<BlockNumber, T>(&self) -> Option<Forks<BlockNumber, T>>
       where BlockNumber: Ord + Clone + 'static,
             T: Group + 'static,
             <Self::Forks as IsForks>::Extension: Extension,
             <<Self::Forks as IsForks>::Extension as Group>::Fork: Extension { ... }
}
Expand description

A collection of ChainSpec extensions.

This type can be passed around and allows the core modules to request a strongly-typed, but optional configuration.

Required Associated Types§

source

type Forks: IsForks

Required Methods§

source

fn get<T>(&self) -> Option<&T>
where T: 'static,

Get an extension of specific type.

source

fn get_any(&self, t: TypeId) -> &(dyn Any + 'static)

Get an extension of specific type as reference to Any.

source

fn get_any_mut(&mut self, t: TypeId) -> &mut (dyn Any + 'static)

Get an extension of specific type as mutable reference to Any.

Provided Methods§

source

fn forks<BlockNumber, T>(&self) -> Option<Forks<BlockNumber, T>>
where BlockNumber: Ord + Clone + 'static, T: Group + 'static, <Self::Forks as IsForks>::Extension: Extension, <<Self::Forks as IsForks>::Extension as Group>::Fork: Extension,

Get forkable extensions of specific type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Extension for Option<()>

§

type Forks = Option<()>

source§

fn get<T>(&self) -> Option<&T>
where T: 'static,

source§

fn get_any(&self, _t: TypeId) -> &(dyn Any + 'static)

source§

fn get_any_mut(&mut self, _: TypeId) -> &mut (dyn Any + 'static)

Implementors§

source§

impl<B, E> Extension for Forks<B, E>
where B: Serialize + DeserializeOwned + Ord + Clone + 'static, E: Extension + Group + 'static,

§

type Forks = Forks<B, E>