pub struct CommandRouter { /* private fields */ }
Expand description
Command routing and dispatch logic
Implementations§
Source§impl CommandRouter
impl CommandRouter
Sourcepub async fn with_peer_manager() -> Result<Self, CliError>
pub async fn with_peer_manager() -> Result<Self, CliError>
Create CommandRouter with initialized PeerManager
Sourcepub async fn handle_node_status(args: StatusArgs) -> Result<String, CliError>
pub async fn handle_node_status(args: StatusArgs) -> Result<String, CliError>
Route and execute node status command
Sourcepub async fn handle_peer_list(&self, port: Option<u16>) -> Result<(), CliError>
pub async fn handle_peer_list(&self, port: Option<u16>) -> Result<(), CliError>
Route and execute peer list command
Sourcepub async fn handle_peer_add(
&self,
address: String,
port: Option<u16>,
nickname: Option<String>,
) -> Result<(), CliError>
pub async fn handle_peer_add( &self, address: String, port: Option<u16>, nickname: Option<String>, ) -> Result<(), CliError>
Route and execute peer add command
Sourcepub async fn handle_peer_remove(
&self,
peer_id: String,
port: Option<u16>,
force: bool,
) -> Result<(), CliError>
pub async fn handle_peer_remove( &self, peer_id: String, port: Option<u16>, force: bool, ) -> Result<(), CliError>
Route and execute peer remove command
Sourcepub async fn handle_network_stats(
&self,
port: Option<u16>,
verbose: bool,
) -> Result<(), CliError>
pub async fn handle_network_stats( &self, port: Option<u16>, verbose: bool, ) -> Result<(), CliError>
Route and execute network stats command
Sourcepub async fn handle_network_test(
&self,
port: Option<u16>,
) -> Result<(), CliError>
pub async fn handle_network_test( &self, port: Option<u16>, ) -> Result<(), CliError>
Route and execute network test command
Sourcepub async fn handle_peer_info(
&self,
peer_id: String,
port: Option<u16>,
) -> Result<(), CliError>
pub async fn handle_peer_info( &self, peer_id: String, port: Option<u16>, ) -> Result<(), CliError>
Route and execute peer info command
Sourcepub async fn handle_peer_ban(
&self,
peer_id: String,
port: Option<u16>,
) -> Result<(), CliError>
pub async fn handle_peer_ban( &self, peer_id: String, port: Option<u16>, ) -> Result<(), CliError>
Route and execute peer ban command
Sourcepub async fn handle_peer_unban(
&self,
address: String,
port: Option<u16>,
) -> Result<(), CliError>
pub async fn handle_peer_unban( &self, address: String, port: Option<u16>, ) -> Result<(), CliError>
Route and execute peer unban command
Sourcepub async fn handle_peer_import(
&self,
path: PathBuf,
merge: bool,
) -> Result<(), CliError>
pub async fn handle_peer_import( &self, path: PathBuf, merge: bool, ) -> Result<(), CliError>
Route and execute peer import command
Sourcepub async fn handle_peer_export(
&self,
path: PathBuf,
tags: Option<Vec<String>>,
) -> Result<(), CliError>
pub async fn handle_peer_export( &self, path: PathBuf, tags: Option<Vec<String>>, ) -> Result<(), CliError>
Route and execute peer export command
Sourcepub async fn handle_peer_test(&self) -> Result<(), CliError>
pub async fn handle_peer_test(&self) -> Result<(), CliError>
Route and execute peer test command
Sourcepub async fn handle_vault_init(
&self,
path: Option<PathBuf>,
force: bool,
) -> Result<(), CliError>
pub async fn handle_vault_init( &self, path: Option<PathBuf>, force: bool, ) -> Result<(), CliError>
Route and execute vault init command
Sourcepub async fn handle_vault_add(
&self,
label: String,
username: String,
generate: bool,
length: usize,
symbols: bool,
) -> Result<(), CliError>
pub async fn handle_vault_add( &self, label: String, username: String, generate: bool, length: usize, symbols: bool, ) -> Result<(), CliError>
Route and execute vault add command
Sourcepub async fn handle_vault_get(
&self,
label: String,
clipboard: bool,
show: bool,
) -> Result<(), CliError>
pub async fn handle_vault_get( &self, label: String, clipboard: bool, show: bool, ) -> Result<(), CliError>
Route and execute vault get command
Sourcepub async fn handle_vault_list(
&self,
category: Option<String>,
format: String,
verbose: bool,
) -> Result<(), CliError>
pub async fn handle_vault_list( &self, category: Option<String>, format: String, verbose: bool, ) -> Result<(), CliError>
Route and execute vault list command
Sourcepub async fn handle_vault_remove(
&self,
label: String,
force: bool,
) -> Result<(), CliError>
pub async fn handle_vault_remove( &self, label: String, force: bool, ) -> Result<(), CliError>
Route and execute vault remove command
Sourcepub async fn handle_vault_update(
&self,
label: String,
username: Option<String>,
generate: bool,
password: Option<String>,
) -> Result<(), CliError>
pub async fn handle_vault_update( &self, label: String, username: Option<String>, generate: bool, password: Option<String>, ) -> Result<(), CliError>
Route and execute vault update command
Sourcepub async fn handle_vault_export(
&self,
output: PathBuf,
format: String,
) -> Result<(), CliError>
pub async fn handle_vault_export( &self, output: PathBuf, format: String, ) -> Result<(), CliError>
Route and execute vault export command
Sourcepub async fn handle_vault_import(
&self,
input: PathBuf,
merge: bool,
_force: bool,
) -> Result<(), CliError>
pub async fn handle_vault_import( &self, input: PathBuf, merge: bool, _force: bool, ) -> Result<(), CliError>
Route and execute vault import command
Sourcepub async fn handle_vault_passwd(&self) -> Result<(), CliError>
pub async fn handle_vault_passwd(&self) -> Result<(), CliError>
Route and execute vault passwd command
Sourcepub async fn handle_vault_stats(&self, verbose: bool) -> Result<(), CliError>
pub async fn handle_vault_stats(&self, verbose: bool) -> Result<(), CliError>
Route and execute vault stats command
Sourcepub async fn handle_vault_generate(
&self,
length: usize,
symbols: bool,
numbers: bool,
clipboard: bool,
count: usize,
) -> Result<(), CliError>
pub async fn handle_vault_generate( &self, length: usize, symbols: bool, numbers: bool, clipboard: bool, count: usize, ) -> Result<(), CliError>
Route and execute vault generate command
Sourcepub async fn handle_vault_config_show(&self) -> Result<(), CliError>
pub async fn handle_vault_config_show(&self) -> Result<(), CliError>
Route and execute vault config show command
Sourcepub async fn handle_vault_config_set(
&self,
key: String,
value: String,
) -> Result<(), CliError>
pub async fn handle_vault_config_set( &self, key: String, value: String, ) -> Result<(), CliError>
Route and execute vault config set command
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandRouter
impl !RefUnwindSafe for CommandRouter
impl Send for CommandRouter
impl Sync for CommandRouter
impl Unpin for CommandRouter
impl !UnwindSafe for CommandRouter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more