pub enum MeshFirewallCommand {
Apply(MeshFirewallApplyArgs),
}Expand description
The mesh firewall subcommands: only apply, because the report is the command
itself with nothing after it. apply is the one mesh operation offered on the command
line alone — it runs a privileged host tool, which nothing reachable over HTTP or MCP
may do — and it refuses without root rather than failing half-way.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshFirewallCommand};
let cli = Cli::try_parse_from(["majordomus", "mesh", "firewall", "apply"]).unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Firewall(firewall) = mesh.command else { panic!("expected `firewall`") };
assert!(matches!(firewall.command, Some(MeshFirewallCommand::Apply(_))));
// nothing else follows `firewall`
assert!(Cli::try_parse_from(["majordomus", "mesh", "firewall", "remove"]).is_err());Variants§
Apply(MeshFirewallApplyArgs)
Run the commands that admit the plan on this host’s firewall; needs root, and exits 10 when it refuses or the firewall still does not admit the mesh
Trait Implementations§
Source§impl Debug for MeshFirewallCommand
impl Debug for MeshFirewallCommand
Source§impl FromArgMatches for MeshFirewallCommand
impl FromArgMatches for MeshFirewallCommand
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<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Subcommand for MeshFirewallCommand
impl Subcommand for MeshFirewallCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for MeshFirewallCommand
impl RefUnwindSafe for MeshFirewallCommand
impl Send for MeshFirewallCommand
impl Sync for MeshFirewallCommand
impl Unpin for MeshFirewallCommand
impl UnsafeUnpin for MeshFirewallCommand
impl UnwindSafe for MeshFirewallCommand
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