[][src]Struct substrate_service::LightComponents

pub struct LightComponents<Factory: ServiceFactory> { /* fields omitted */ }

A struct that implement Components for the light client.

Methods

impl<Factory: ServiceFactory> LightComponents<Factory>[src]

pub fn new(config: FactoryFullConfiguration<Factory>) -> Result<Self, Error>[src]

Create new LightComponents

Methods from Deref<Target = Service<Self>>

pub fn config(&self) -> &FactoryFullConfiguration<Components::Factory>[src]

Returns a reference to the config passed at initialization.

pub fn config_mut(
    &mut self
) -> &mut FactoryFullConfiguration<Components::Factory>
[src]

Returns a reference to the config passed at initialization.

Note: This method is currently necessary because we extract some elements from the configuration at the end of the service initialization. It is intended to be removed.

pub fn telemetry_on_connect_stream(&self) -> TelemetryOnConnectNotifications[src]

Get event stream for telemetry connection established events.

pub fn telemetry(&self) -> Option<Telemetry>[src]

Return a shared instance of Telemetry (if enabled)

pub fn keystore(&self) -> KeyStorePtr[src]

Returns the keystore instance.

pub fn spawn_task(
    &self,
    task: impl Future<Item = (), Error = ()> + Send + 'static
)
[src]

Spawns a task in the background that runs the future passed as parameter.

pub fn spawn_essential_task(
    &self,
    task: impl Future<Item = (), Error = ()> + Send + 'static
)
[src]

Spawns a task in the background that runs the future passed as parameter. The given task is considered essential, i.e. if it errors we trigger a service exit.

pub fn spawn_task_handle(&self) -> SpawnTaskHandle[src]

Returns a handle for spawning tasks.

pub fn rpc_query(
    &self,
    mem: &RpcSession,
    request: &str
) -> impl Future<Item = Option<String>, Error = ()>
[src]

Starts an RPC query.

The query is passed as a string and must be a JSON text similar to what an HTTP client would for example send.

Returns a Future that contains the optional response.

If the request subscribes you to events, the Sender in the RpcSession object is used to send back spontaneous events.

pub fn client(&self) -> Arc<ComponentClient<Components>>[src]

Get shared client instance.

pub fn select_chain(&self) -> Option<<Components as Components>::SelectChain>[src]

Get clone of select chain.

pub fn network(&self) -> Arc<NetworkService<Components>>[src]

Get shared network instance.

pub fn network_status(
    &self
) -> UnboundedReceiver<(NetworkStatus<ComponentBlock<Components>>, NetworkState)>
[src]

Returns a receiver that periodically receives a status of the network.

pub fn transaction_pool(
    &self
) -> Arc<TransactionPool<Components::TransactionPoolApi>>
[src]

Get shared transaction pool instance.

pub fn on_exit(&self) -> Exit[src]

Get a handle to a future that will resolve on exit.

Trait Implementations

impl<Factory: ServiceFactory> Components for LightComponents<Factory>[src]

type Factory = Factory

Associated service factory.

type Executor = LightExecutor<Factory>

Client executor.

type Backend = LightBackend<Factory>

Client backend.

type TransactionPoolApi = <Factory as ServiceFactory>::LightTransactionPoolApi

Extrinsic pool type.

type ImportQueue = <Factory as ServiceFactory>::LightImportQueue

Our Import Queue

type RuntimeApi = Factory::RuntimeApi

The type that implements the runtime API.

type RuntimeServices = Factory::LightService

A type that can start all runtime-dependent services.

type SelectChain = Factory::SelectChain

The Fork Choice Strategy for the chain

impl<Factory: ServiceFactory> Deref for LightComponents<Factory>[src]

type Target = Service<Self>

The resulting type after dereferencing.

impl<Factory: ServiceFactory> DerefMut for LightComponents<Factory>[src]

impl<Factory: ServiceFactory> Future for LightComponents<Factory>[src]

type Item = ()

The type of value that this future will resolved with if it is successful. Read more

type Error = Error

The type of error that this future will resolve with if it fails in a normal fashion. Read more

fn wait(self) -> Result<Self::Item, Self::Error>[src]

Block the current thread until this future is resolved. Read more

fn map<F, U>(self, f: F) -> Map<Self, F> where
    F: FnOnce(Self::Item) -> U, 
[src]

Map this future's result to a different type, returning a new future of the resulting type. Read more

fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> E, 
[src]

Map this future's error to a different error, returning a new future. Read more

fn from_err<E>(self) -> FromErr<Self, E> where
    E: From<Self::Error>, 
[src]

Map this future's error to any error implementing From for this future's Error, returning a new future. Read more

fn then<F, B>(self, f: F) -> Then<Self, B, F> where
    B: IntoFuture,
    F: FnOnce(Result<Self::Item, Self::Error>) -> B, 
[src]

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more

fn and_then<F, B>(self, f: F) -> AndThen<Self, B, F> where
    B: IntoFuture<Error = Self::Error>,
    F: FnOnce(Self::Item) -> B, 
[src]

Execute another future after this one has resolved successfully. Read more

fn or_else<F, B>(self, f: F) -> OrElse<Self, B, F> where
    B: IntoFuture<Item = Self::Item>,
    F: FnOnce(Self::Error) -> B, 
[src]

Execute another future if this one resolves with an error. Read more

fn select<B>(self, other: B) -> Select<Self, <B as IntoFuture>::Future> where
    B: IntoFuture<Item = Self::Item, Error = Self::Error>, 
[src]

Waits for either one of two futures to complete. Read more

fn select2<B>(self, other: B) -> Select2<Self, <B as IntoFuture>::Future> where
    B: IntoFuture
[src]

Waits for either one of two differently-typed futures to complete. Read more

fn join<B>(self, other: B) -> Join<Self, <B as IntoFuture>::Future> where
    B: IntoFuture<Error = Self::Error>, 
[src]

Joins the result of two futures, waiting for them both to complete. Read more

fn join3<B, C>(
    self,
    b: B,
    c: C
) -> Join3<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future> where
    B: IntoFuture<Error = Self::Error>,
    C: IntoFuture<Error = Self::Error>, 
[src]

Same as join, but with more futures.

fn join4<B, C, D>(
    self,
    b: B,
    c: C,
    d: D
) -> Join4<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future> where
    B: IntoFuture<Error = Self::Error>,
    C: IntoFuture<Error = Self::Error>,
    D: IntoFuture<Error = Self::Error>, 
[src]

Same as join, but with more futures.

fn join5<B, C, D, E>(
    self,
    b: B,
    c: C,
    d: D,
    e: E
) -> Join5<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future, <E as IntoFuture>::Future> where
    B: IntoFuture<Error = Self::Error>,
    C: IntoFuture<Error = Self::Error>,
    D: IntoFuture<Error = Self::Error>,
    E: IntoFuture<Error = Self::Error>, 
[src]

Same as join, but with more futures.

fn into_stream(self) -> IntoStream<Self>[src]

Convert this future into a single element stream. Read more

fn flatten(self) -> Flatten<Self> where
    Self::Item: IntoFuture,
    <Self::Item as IntoFuture>::Error: From<Self::Error>, 
[src]

Flatten the execution of this future when the successful result of this future is itself another future. Read more

fn flatten_stream(self) -> FlattenStream<Self> where
    Self::Item: Stream,
    <Self::Item as Stream>::Error == Self::Error
[src]

Flatten the execution of this future when the successful result of this future is a stream. Read more

fn fuse(self) -> Fuse<Self>[src]

Fuse a future such that poll will never again be called once it has completed. Read more

fn inspect<F>(self, f: F) -> Inspect<Self, F> where
    F: FnOnce(&Self::Item), 
[src]

Do something with the item of a future, passing it on. Read more

fn catch_unwind(self) -> CatchUnwind<Self> where
    Self: UnwindSafe
[src]

Catches unwinding panics while polling the future. Read more

fn shared(self) -> Shared<Self>[src]

Create a cloneable handle to this future where all handles will resolve to the same result. Read more

impl<Factory: ServiceFactory> Executor<Box<dyn Future<Item = (), Error = ()> + 'static + Send>> for LightComponents<Factory>[src]

Auto Trait Implementations

impl<Factory> Send for LightComponents<Factory> where
    <Factory as ServiceFactory>::Block: Block + Send + Sync,
    <Factory as ServiceFactory>::Configuration: Send,
    <<Factory as ServiceFactory>::Block as Block>::Extrinsic: Send + Sync,
    <<Factory as ServiceFactory>::Block as Block>::Header: Header + Send,
    <Factory as ServiceFactory>::LightTransactionPoolApi: ChainApi + Send + Sync,
    <<<Factory as ServiceFactory>::Block as Block>::Header as Header>::Number: Send + Sync,
    <Factory as ServiceFactory>::RuntimeApi: Send + Sync,
    <Factory as ServiceFactory>::RuntimeDispatch: Send + Sync,
    <Factory as ServiceFactory>::SelectChain: Send

impl<Factory> Unpin for LightComponents<Factory> where
    <Factory as ServiceFactory>::Block: Block,
    <Factory as ServiceFactory>::Configuration: Unpin,
    <<Factory as ServiceFactory>::Block as Block>::Header: Header,
    <Factory as ServiceFactory>::SelectChain: Unpin

impl<Factory> !Sync for LightComponents<Factory>

impl<Factory> !UnwindSafe for LightComponents<Factory>

impl<Factory> !RefUnwindSafe for LightComponents<Factory>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Erased for T[src]

impl<T> CheckedConversion for T[src]

fn checked_from<T>(t: T) -> Option<Self> where
    Self: TryFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Option<Self>. Read more

fn checked_into<T>(self) -> Option<T> where
    Self: TryInto<T>, 
[src]

Consume self to return Some equivalent value of Option<T>. Read more

impl<T> SaturatedConversion for T[src]

fn saturated_from<T>(t: T) -> Self where
    Self: UniqueSaturatedFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Self. Read more

fn saturated_into<T>(self) -> T where
    Self: UniqueSaturatedInto<T>, 
[src]

Consume self to return an equivalent value of T. Read more

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<Fut> Future01CompatExt for Fut where
    Fut: Future
[src]

fn compat(self) -> Compat01As03<Self>[src]

Converts a futures 0.1 Future<Item = T, Error = E> into a futures 0.3 Future<Output = Result<T, E>>. Read more

impl<F> IntoFuture for F where
    F: Future
[src]

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

fn timeout(self, timeout: Duration) -> Timeout<Self>[src]

Creates a new future which allows self until timeout. Read more

impl<T> Erased for T[src]

impl<T> Typeable for T where
    T: Any
[src]

fn get_type(&self) -> TypeId[src]

Get the TypeId of this object.