Struct kaspa_cli_lib::KaspaCli

source ·
pub struct KaspaCli { /* private fields */ }

Implementations§

source§

impl KaspaCli

source

pub fn init()

source

pub async fn try_new_arc(options: Options) -> Result<Arc<Self>>

source

pub fn term(&self) -> Arc<Terminal>

source

pub fn try_term(&self) -> Option<Arc<Terminal>>

source

pub fn notifier(&self) -> &Notifier

source

pub fn version(&self) -> String

source

pub fn wallet(&self) -> Arc<Wallet>

source

pub fn is_connected(&self) -> bool

source

pub fn rpc_api(&self) -> Arc<DynRpcApi>

source

pub fn rpc_client(&self) -> Option<Arc<KaspaRpcClient>>

source

pub fn store(&self) -> Arc<dyn Interface>

source

pub fn daemons(&self) -> &Arc<Daemons>

source

pub fn handlers(&self) -> Arc<HandlerCli>

source

pub fn flags(&self) -> &Flags

source

pub fn toggle_mute(&self) -> &'static str

source

pub fn is_mutted(&self) -> bool

source

pub fn register_metrics(self: &Arc<Self>) -> Result<()>

source

pub fn register_handlers(self: &Arc<Self>) -> Result<()>

source

pub async fn handle_daemon_event( self: &Arc<Self>, event: DaemonEvent ) -> Result<()>

source

pub async fn start(self: &Arc<Self>) -> Result<()>

source

pub async fn run(self: &Arc<Self>) -> Result<()>

source

pub async fn stop(self: &Arc<Self>) -> Result<()>

source

pub async fn account(&self) -> Result<Arc<dyn Account>>

source

pub async fn find_accounts_by_name_or_id( &self, pat: &str ) -> Result<Arc<dyn Account>>

source

pub async fn prompt_account(&self) -> Result<Arc<dyn Account>>

source

pub async fn select_account(&self) -> Result<Arc<dyn Account>>

source

pub async fn select_private_key(&self) -> Result<Arc<PrvKeyDataInfo>>

source

pub async fn select_private_key_with_args( &self, autoselect: bool ) -> Result<Arc<PrvKeyDataInfo>>

source

pub async fn list(&self) -> Result<()>

source

pub async fn shutdown(&self) -> Result<()>

source§

impl KaspaCli

source

pub fn init_panic_hook(self: &Arc<Self>)

Trait Implementations§

source§

impl AsRef<KaspaCli> for KaspaCli

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Cli for KaspaCli

source§

fn init(self: Arc<Self>, term: &Arc<Terminal>) -> TerminalResult<()>

source§

fn digest<'async_trait>( self: Arc<Self>, term: Arc<Terminal>, cmd: String ) -> Pin<Box<dyn Future<Output = TerminalResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,

source§

fn complete<'async_trait>( self: Arc<Self>, _term: Arc<Terminal>, cmd: String ) -> Pin<Box<dyn Future<Output = TerminalResult<Option<Vec<String>>>> + Send + 'async_trait>>
where Self: 'async_trait,

source§

fn prompt(&self) -> Option<String>

source§

impl Context for KaspaCli

source§

fn term(&self) -> Arc<Terminal>

source§

impl From<&KaspaCli> for Arc<Terminal>

source§

fn from(ctx: &KaspaCli) -> Arc<Terminal>

Converts to this type from the input type.
source§

impl Sink for KaspaCli

source§

fn write( &self, _target: Option<&str>, _level: Level, args: &Arguments<'_> ) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Any for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

source§

fn type_name(&self) -> &'static str

source§

impl<T> AnySync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<T> AsAny for T
where T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<S> CastArc for S
where S: CastFromSync + ?Sized,

§

fn cast<T>(self: Arc<S>) -> Result<Arc<T>, Arc<S>>
where T: 'static + ?Sized,

Casts an Arc for this trait into that for type T.
§

impl<S> CastBox for S
where S: CastFrom + ?Sized,

§

fn cast<T>(self: Box<S>) -> Result<Box<T>, Box<S>>
where T: 'static + ?Sized,

Casts a box to this trait into that of type T. If fails, returns the receiver.
§

impl<T> CastFrom for T
where T: Any + 'static,

§

fn ref_any(&self) -> &(dyn Any + 'static)

Returns a immutable reference to Any, which is backed by the type implementing this trait.
§

fn mut_any(&mut self) -> &mut (dyn Any + 'static)

Returns a mutable reference to Any, which is backed by the type implementing this trait.
§

fn box_any(self: Box<T>) -> Box<dyn Any>

Returns a Box of Any, which is backed by the type implementing this trait.
§

fn rc_any(self: Rc<T>) -> Rc<dyn Any>

Returns an Rc of Any, which is backed by the type implementing this trait.
§

impl<T> CastFromSync for T
where T: Sync + Send + 'static,

§

fn arc_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<S> CastMut for S
where S: CastFrom + ?Sized,

§

fn cast<T>(&mut self) -> Option<&mut T>
where T: 'static + ?Sized,

Casts a mutable reference to this trait into that of type T.
§

impl<S> CastRc for S
where S: CastFrom + ?Sized,

§

fn cast<T>(self: Rc<S>) -> Result<Rc<T>, Rc<S>>
where T: 'static + ?Sized,

Casts an Rc for this trait into that for type T.
§

impl<S> CastRef for S
where S: CastFrom + ?Sized,

§

fn cast<T>(&self) -> Option<&T>
where T: 'static + ?Sized,

Casts a reference to this trait into that of type T.
§

fn impls<T>(&self) -> bool
where T: 'static + ?Sized,

Tests if this trait object can be cast into T.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

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

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

§

fn exact_from(value: T) -> U

§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

§

fn exact_into(self) -> U

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

§

fn overflowing_into(self) -> (U, bool)

§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

§

fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)

source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

§

fn saturating_into(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

§

fn wrapping_into(self) -> U

§

impl<T> UnsafeAny for T
where T: Any,