pub struct MeshPeerArgs {
pub runtime: String,
pub query: MeshQueryArgs,
}Expand description
mesh peer: which single runtime of the mesh to describe. The runtime key is
<node>-<runtime>, and a bare node id is accepted as a shorthand for that node’s first
runtime, because a machine running one server is the common case and spelling its
runtime out adds nothing. The key is positional and required: a peer question with no
subject is peers, which is a different command.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshPeerArgs};
let cli = Cli::try_parse_from(["majordomus", "mesh", "peer", "a1b2c3d4-r1"]).unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Peer(peer) = mesh.command else { panic!("expected `peer`") };
assert_eq!(peer.runtime, "a1b2c3d4-r1");
// the runtime is the whole question, so there is no answer without one
assert!(Cli::try_parse_from(["majordomus", "mesh", "peer"]).is_err());Fields§
§runtime: StringThe runtime key <node>-<runtime>, or a node id for its first runtime
query: MeshQueryArgsWhere the repository is and how to answer.
Trait Implementations§
Source§impl Args for MeshPeerArgs
impl Args for MeshPeerArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl Debug for MeshPeerArgs
impl Debug for MeshPeerArgs
Source§impl FromArgMatches for MeshPeerArgs
impl FromArgMatches for MeshPeerArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl Freeze for MeshPeerArgs
impl RefUnwindSafe for MeshPeerArgs
impl Send for MeshPeerArgs
impl Sync for MeshPeerArgs
impl Unpin for MeshPeerArgs
impl UnsafeUnpin for MeshPeerArgs
impl UnwindSafe for MeshPeerArgs
Blanket Implementations§
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
Mutably borrows from an owned value. Read more