Struct tc_cli::Runner[][src]

pub struct Runner<C: TetcoreCli> { /* fields omitted */ }

A Tetcore CLI runtime that can be used to run a node or a command

Implementations

impl<C: TetcoreCli> Runner<C>[src]

pub fn new<T: CliConfiguration>(
    cli: &C,
    command: &T,
    telemetry_worker: TelemetryWorker
) -> Result<Runner<C>>
[src]

Create a new runtime with the command provided in argument

pub fn run_node_until_exit<F, E>(
    self,
    initialize: impl FnOnce(Configuration) -> F
) -> Result<(), E> where
    F: Future<Output = Result<TaskManager, E>>,
    E: Error + Send + Sync + 'static + From<ServiceError>, 
[src]

A helper function that runs a node with tokio and stops if the process receives the signal SIGTERM or SIGINT.

pub fn sync_run<E>(
    self,
    runner: impl FnOnce(Configuration) -> Result<(), E>
) -> Result<(), E> where
    E: Error + Send + Sync + 'static + From<ServiceError>, 
[src]

A helper function that runs a command with the configuration of this node.

pub fn async_run<F, E>(
    self,
    runner: impl FnOnce(Configuration) -> Result<(F, TaskManager), E>
) -> Result<(), E> where
    F: Future<Output = Result<(), E>>,
    E: Error + Send + Sync + 'static + From<ServiceError> + From<CliError>, 
[src]

A helper function that runs a future with tokio and stops if the process receives the signal SIGTERM or SIGINT.

pub fn config(&self) -> &Configuration[src]

Get an immutable reference to the node Configuration

pub fn config_mut(&mut self) -> &mut Configuration[src]

Get a mutable reference to the node Configuration

pub fn telemetry_handle(&self) -> TelemetryHandle[src]

Get a new TelemetryHandle.

This is used when you want to register with the TelemetryWorker.

Auto Trait Implementations

impl<C> !RefUnwindSafe for Runner<C>

impl<C> Send for Runner<C> where
    C: Send

impl<C> Sync for Runner<C> where
    C: Sync

impl<C> Unpin for Runner<C> where
    C: Unpin

impl<C> !UnwindSafe for Runner<C>

Blanket Implementations

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

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

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

impl<T> CheckedConversion for T[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

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

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

Get a reference to the inner from the outer.

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

Get a mutable reference to the inner from the outer.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]