pub struct TimingOptions {
pub deadline: Option<Duration>,
}Expand description
Execution timing requests shared by program commands.
Flatten this alongside a program’s options in a host’s Clap arguments.
The deadline is a relative duration, not an absolute timestamp. It defaults
to None, leaving timing policy to the implementation. Clap accepts
human-readable durations such as 30s or 1m 30s, including zero.
These options do not enforce timeouts. Hosts can forward an explicit value
using deadline_option() (available with std or clap). Cache freshness
is configured separately by crate::CachingOptions.
Fields§
§deadline: Option<Duration>Allow at most this duration for the command (for example, 30s).
Implementations§
Source§impl TimingOptions
impl TimingOptions
Sourcepub fn builder() -> TimingOptionsBuilder
pub fn builder() -> TimingOptionsBuilder
Create an instance of TimingOptions using the builder syntax
Source§impl TimingOptions
impl TimingOptions
Sourcepub fn deadline_option(&self) -> Option<String>
Available on crate features clap or std only.
pub fn deadline_option(&self) -> Option<String>
clap or std only.Formats an explicit deadline as one --deadline=DURATION argument.
Returns None when unset; a zero duration is forwarded as 0s.
Trait Implementations§
Source§impl Args for TimingOptions
Available on crate feature clap only.
impl Args for TimingOptions
clap only.Source§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
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for TimingOptions
impl Clone for TimingOptions
Source§impl Debug for TimingOptions
impl Debug for TimingOptions
Source§impl Default for TimingOptions
impl Default for TimingOptions
Source§impl<'de> Deserialize<'de> for TimingOptions
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TimingOptions
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TimingOptions
Source§impl FromArgMatches for TimingOptions
Available on crate feature clap only.
impl FromArgMatches for TimingOptions
clap only.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>
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>
ArgMatches to self.Source§impl Hash for TimingOptions
impl Hash for TimingOptions
Source§impl Ord for TimingOptions
impl Ord for TimingOptions
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TimingOptions
impl PartialEq for TimingOptions
Source§impl PartialOrd for TimingOptions
impl PartialOrd for TimingOptions
Source§impl Serialize for TimingOptions
Available on crate feature serde only.
impl Serialize for TimingOptions
serde only.