pub struct MeshSessionArgs {
pub command: MeshSessionCommand,
}Expand description
mesh session: the group that carries a session’s lifecycle on the mesh. The group
itself runs nothing — every runnable path under it is open or close — so it refuses
to be invoked bare rather than guessing which half of a lifecycle was meant.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshSessionArgs, MeshSessionCommand};
let cli =
Cli::try_parse_from(["majordomus", "mesh", "session", "close", "--session", "s1"]).unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Session(session) = mesh.command else { panic!("expected `session`") };
let session: MeshSessionArgs = session;
assert!(matches!(session.command, MeshSessionCommand::Close(_)));
// the group has no behaviour of its own
assert!(Cli::try_parse_from(["majordomus", "mesh", "session"]).is_err());Fields§
§command: MeshSessionCommandopen or close.
Trait Implementations§
Source§impl Args for MeshSessionArgs
impl Args for MeshSessionArgs
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 MeshSessionArgs
impl Debug for MeshSessionArgs
Source§impl FromArgMatches for MeshSessionArgs
impl FromArgMatches for MeshSessionArgs
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 MeshSessionArgs
impl RefUnwindSafe for MeshSessionArgs
impl Send for MeshSessionArgs
impl Sync for MeshSessionArgs
impl Unpin for MeshSessionArgs
impl UnsafeUnpin for MeshSessionArgs
impl UnwindSafe for MeshSessionArgs
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