Struct sc_cli::Runner [−][src]
A Substrate CLI runtime that can be used to run a node or a command
Implementations
impl<C: SubstrateCli> Runner<C>
[src][−]
pub fn new<T: CliConfiguration>(
cli: &C,
command: &T,
telemetry_worker: TelemetryWorker
) -> Result<Runner<C>>
[src][−]
cli: &C,
command: &T,
telemetry_worker: TelemetryWorker
) -> Result<Runner<C>>
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][−]
self,
initialize: impl FnOnce(Configuration) -> F
) -> Result<(), E> where
F: Future<Output = Result<TaskManager, E>>,
E: Error + Send + Sync + 'static + From<ServiceError>,
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][−]
self,
runner: impl FnOnce(Configuration) -> Result<(), E>
) -> Result<(), E> where
E: Error + Send + Sync + 'static + From<ServiceError>,
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][−]
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>,
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,
C: Send,
impl<C> Sync for Runner<C> where
C: Sync,
C: Sync,
impl<C> Unpin for Runner<C> where
C: Unpin,
C: Unpin,
impl<C> !UnwindSafe for Runner<C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> CheckedConversion for T
[src][+]
impl<T> Erased for T
[src]
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][+]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
[src][+]
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
impl<T> Pointable for T
[src][+]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
[src][+]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src][+]
T: UncheckedFrom<S>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
[src][+]
T: Bounded,
S: TryInto<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,