Args

Struct Args 

pub struct Args {
    dir: Vec<PathBuf>,
    follow: bool,
    kernel: bool,
    kernel_only: bool,
    service: Vec<String>,
    target: Vec<String>,
    since: DateTimeArg,
    until: Option<DateTimeArg>,
}
Expand description

View log files.

--since and --until define a half-open time range of log events to include in the output. If not specified, --since defaults to 1 hour ago and --until is not set.

Fields§

§dir: Vec<PathBuf>

Directory containing log files.

§follow: bool

Follow log files as they are written.

§kernel: bool

Include kernel log events.

§kernel_only: bool

Only include kernel log events, not service log events.

§service: Vec<String>

Services to include in the output.

§target: Vec<String>

Target prefixes to include in the output.

§since: DateTimeArg

Start of the time range to include in the output.

Can be either an RFC3339 timestamp, a relative duration, “now” or “boot”.

§until: Option<DateTimeArg>

(Exclusive) End of the time range to include in the output.

Can be either an RFC3339 timestamp, a relative duration, “now” or “boot”.

Implementations§

§

impl Args

const fn wants_kernel(&self) -> bool

Whether to include kernel log events.

const fn wants_any_services(&self) -> bool

Whether to include any service log events.

fn wants_service(&self, service: &str) -> bool

Whether to include service log events for the given service.

fn wants_target(&self, target: &str) -> bool

Whether to include log events for the given target.

fn order_timestamp(&self, timestamp: DateTime<Utc>) -> Ordering

Compares the given timestamp to the desired time span.

Returns Ordering::Less if the timestamp is before the since time, Ordering::Greater if the timestamp is after the until time, and Ordering::Equal if the timestamp is within the desired time span.

fn wants_timestamp(&self, timestamp: DateTime<Utc>) -> bool

Whether to include log events with the given timestamp.

fn wants_timestamp_range( &self, (start, end): (DateTime<Utc>, DateTime<Utc>), ) -> bool

Whether to include any log events from within the given time range.

The time range is given as a half-open interval [start, end).

A return value of true indicates that some timestamps within the range are of interest, not necessarily all. Specific timestamps must still be checked with Args::wants_timestamp.

Trait Implementations§

§

impl Args for Args

§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
§

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 more
§

impl Clone for Args

§

fn clone(&self) -> Args

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Args

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl FromArgMatches for Args

§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
§

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 Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more