pub struct MeshEventsArgs {
pub after: Option<u64>,
pub limit: Option<u64>,
pub newest: bool,
pub query: MeshQueryArgs,
}Expand description
mesh events: a window onto the cooperation journal, in Lamport order. --after is a
resume point rather than a timestamp, so a caller that remembers the last stamp it saw
reads each event exactly once however the clocks of the machines involved disagree;
--limit bounds one answer. Both are optional, and saying neither asks for the newest
page under the server’s own default.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, MeshCommand, MeshEventsArgs};
let cli =
Cli::try_parse_from(["majordomus", "mesh", "events", "--after", "42", "--limit", "10"])
.unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Events(events) = mesh.command else { panic!("expected `events`") };
assert_eq!(events.after, Some(42));
assert_eq!(events.limit, Some(10));
// neither flag is the whole journal under the server's default page
let cli = Cli::try_parse_from(["majordomus", "mesh", "events"]).unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Events(events) = mesh.command else { panic!("expected `events`") };
assert_eq!((events.after, events.limit), (None, None));
assert!(!events.newest);
// the journal as it stands now: its newest events
let cli = Cli::try_parse_from(["majordomus", "mesh", "events", "--newest"]).unwrap();
let Command::Mesh(mesh) = cli.command else { panic!("expected `mesh`") };
let MeshCommand::Events(events) = mesh.command else { panic!("expected `events`") };
assert!(events.newest);Fields§
§after: Option<u64>Only events whose Lamport stamp is above this
limit: Option<u64>At most this many (default 100, at most 1000)
newest: boolThe newest events instead of the first ones after --after
query: MeshQueryArgsWhere the repository is and how to answer.
Trait Implementations§
Source§impl Args for MeshEventsArgs
impl Args for MeshEventsArgs
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 MeshEventsArgs
impl Debug for MeshEventsArgs
Source§impl FromArgMatches for MeshEventsArgs
impl FromArgMatches for MeshEventsArgs
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 MeshEventsArgs
impl RefUnwindSafe for MeshEventsArgs
impl Send for MeshEventsArgs
impl Sync for MeshEventsArgs
impl Unpin for MeshEventsArgs
impl UnsafeUnpin for MeshEventsArgs
impl UnwindSafe for MeshEventsArgs
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