pub struct MeshClaimArgs {
pub scope: Vec<String>,
pub session: String,
pub intent: Option<String>,
pub advisory: bool,
pub issue: Option<String>,
pub task: Option<String>,
pub query: MeshQueryArgs,
}Expand description
mesh claim: the paths a session takes, the session taking them, and whether the claim
refuses an overlap or only reports one. The scope is positional and repeatable because
a claim over nothing is not a claim; --session is required because a claim belongs to
a session and ends with it, and --advisory is the difference between a claim that can
refuse another runtime’s and one that only makes the overlap visible.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshClaimArgs, MeshCommand};
let cli = Cli::try_parse_from([
"majordomus", "mesh", "claim", "src/mesh", "docs/MESH.md",
"--session", "s1", "--intent", "document the mesh",
])
.unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Claim(claim) = mesh.command else { panic!("expected `claim`") };
assert_eq!(claim.scope, ["src/mesh", "docs/MESH.md"]);
assert_eq!(claim.session, "s1");
assert!(!claim.advisory, "a claim refuses an overlap unless it says otherwise");
// a claim over no path at all is a parse error, not an empty claim
assert!(Cli::try_parse_from(["majordomus", "mesh", "claim", "--session", "s1"]).is_err());Fields§
§scope: Vec<String>Repository-relative paths to claim
session: StringThe claiming session’s id within this runtime (opened when new)
intent: Option<String>What the claim is for
advisory: boolAn advisory claim: overlaps are reported, never refused
issue: Option<String>The issue the claim is for
task: Option<String>The task the session works under
query: MeshQueryArgsWhere the repository is and how to answer.
Trait Implementations§
Source§impl Args for MeshClaimArgs
impl Args for MeshClaimArgs
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 MeshClaimArgs
impl Debug for MeshClaimArgs
Source§impl FromArgMatches for MeshClaimArgs
impl FromArgMatches for MeshClaimArgs
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 MeshClaimArgs
impl RefUnwindSafe for MeshClaimArgs
impl Send for MeshClaimArgs
impl Sync for MeshClaimArgs
impl Unpin for MeshClaimArgs
impl UnsafeUnpin for MeshClaimArgs
impl UnwindSafe for MeshClaimArgs
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