pub struct MeshSessionCloseArgs {
pub session: String,
pub query: MeshQueryArgs,
}Expand description
mesh session close: the id of the session that has finished. Closing is the one act
that ends a session’s claims everywhere at once, so it takes the session and nothing
else — there is no partial close, and no flag that could make one.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshSessionCloseArgs, 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 MeshSessionCommand::Close(close) = session.command else { panic!("expected `close`") };
let close: MeshSessionCloseArgs = close;
assert_eq!(close.session, "s1");
// and closing no session in particular is refused
assert!(Cli::try_parse_from(["majordomus", "mesh", "session", "close"]).is_err());Fields§
§session: StringThe session’s id within this runtime
query: MeshQueryArgsWhere the repository is and how to answer.
Trait Implementations§
Source§impl Args for MeshSessionCloseArgs
impl Args for MeshSessionCloseArgs
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 MeshSessionCloseArgs
impl Debug for MeshSessionCloseArgs
Source§impl FromArgMatches for MeshSessionCloseArgs
impl FromArgMatches for MeshSessionCloseArgs
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 MeshSessionCloseArgs
impl RefUnwindSafe for MeshSessionCloseArgs
impl Send for MeshSessionCloseArgs
impl Sync for MeshSessionCloseArgs
impl Unpin for MeshSessionCloseArgs
impl UnsafeUnpin for MeshSessionCloseArgs
impl UnwindSafe for MeshSessionCloseArgs
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