Command

Enum Command 

Source
pub enum Command<'a> {
Show 28 variants Help(Option<&'a str>), Quit, WhoAmI, PeerAdd { pubkey: &'a str, alias: Option<&'a str>, }, PeerAlias { peer: &'a str, alias: &'a str, }, PeerRm { peer: &'a str, }, Peers, Query { peer: &'a str, }, Msg { peer: &'a str, text: &'a str, }, Text { body: &'a str, }, Me { action: &'a str, }, Ping { peer: &'a str, bytes: Option<u16>, }, PfsStart { peer: &'a str, minutes: Option<u16>, }, PfsEnd { peer: &'a str, }, PfsStatus { peer: Option<&'a str>, }, Beacon, ChannelJoin { name: &'a str, key: &'a str, }, ChannelLeave { name: &'a str, }, ChannelSend { name: &'a str, text: &'a str, }, Channels, Stats, Counters, Log { level: &'a str, }, SetShow, Set { var: &'a str, val: &'a str, }, Raw { peer: &'a str, hex: &'a str, }, PowerOff, Reboot,
}
Expand description

A parsed CLI input line. Borrows from the input buffer — the caller is expected to own that buffer on the stack while dispatching.

Variants§

§

Help(Option<&'a str>)

§

Quit

§

WhoAmI

§

PeerAdd

Fields

§pubkey: &'a str
§alias: Option<&'a str>
§

PeerAlias

Fields

§peer: &'a str
§alias: &'a str
§

PeerRm

Fields

§peer: &'a str
§

Peers

§

Query

Fields

§peer: &'a str
§

Msg

Fields

§peer: &'a str
§text: &'a str
§

Text

Fields

§body: &'a str
§

Me

Fields

§action: &'a str
§

Ping

Fields

§peer: &'a str
§bytes: Option<u16>
§

PfsStart

Fields

§peer: &'a str
§minutes: Option<u16>
§

PfsEnd

Fields

§peer: &'a str
§

PfsStatus

Fields

§peer: Option<&'a str>
§

Beacon

§

ChannelJoin

Fields

§name: &'a str
§key: &'a str
§

ChannelLeave

Fields

§name: &'a str
§

ChannelSend

Fields

§name: &'a str
§text: &'a str
§

Channels

§

Stats

§

Counters

§

Log

Fields

§level: &'a str
§

SetShow

§

Set

Fields

§var: &'a str
§val: &'a str
§

Raw

Fields

§peer: &'a str
§hex: &'a str
§

PowerOff

§

Reboot

Trait Implementations§

Source§

impl<'a> Debug for Command<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for Command<'a>

Source§

fn eq(&self, other: &Command<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for Command<'a>

Source§

impl<'a> StructuralPartialEq for Command<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Command<'a>

§

impl<'a> RefUnwindSafe for Command<'a>

§

impl<'a> Send for Command<'a>

§

impl<'a> Sync for Command<'a>

§

impl<'a> Unpin for Command<'a>

§

impl<'a> UnwindSafe for Command<'a>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.