pub struct MeshFirewallApplyArgs {
pub port: Option<u16>,
pub query: MeshQueryArgs,
}Expand description
mesh firewall apply: the same --port the report takes, because the commands it
runs are the report’s, and the same repository and output arguments, so that
--format json prints the apply report unchanged for a script that records what ran.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshFirewallApplyArgs, MeshFirewallCommand, OutputFormat};
let cli = Cli::try_parse_from(["majordomus", "mesh", "firewall", "apply", "--port", "8791", "--format", "json"]).unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Firewall(firewall) = mesh.command else { panic!("expected `firewall`") };
let Some(MeshFirewallCommand::Apply(apply)) = firewall.command else { panic!("expected `apply`") };
let apply: MeshFirewallApplyArgs = apply;
assert_eq!(apply.port, Some(8791));
assert_eq!(apply.query.format, OutputFormat::Json);Fields§
§port: Option<u16>The port this checkout’s server listens on beyond loopback, when it does
query: MeshQueryArgsWhere the repository is and how to answer.
Trait Implementations§
Source§impl Args for MeshFirewallApplyArgs
impl Args for MeshFirewallApplyArgs
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 MeshFirewallApplyArgs
impl Debug for MeshFirewallApplyArgs
Source§impl FromArgMatches for MeshFirewallApplyArgs
impl FromArgMatches for MeshFirewallApplyArgs
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 MeshFirewallApplyArgs
impl RefUnwindSafe for MeshFirewallApplyArgs
impl Send for MeshFirewallApplyArgs
impl Sync for MeshFirewallApplyArgs
impl Unpin for MeshFirewallApplyArgs
impl UnsafeUnpin for MeshFirewallApplyArgs
impl UnwindSafe for MeshFirewallApplyArgs
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