pub struct CachingOptions {
pub max_age: Option<Duration>,
}Expand description
Cache freshness requests shared by fetcher and lister commands.
Flatten this alongside crate::FetcherOptions or crate::ListerOptions
in a host’s Clap arguments. The maximum age defaults to None, leaving
policy to the selected module. Clap accepts durations such as 1h,
7d, or 1m 30s; it rejects a zero maximum age.
Builders and direct field assignments do not validate durations.
With serde, the wire name is max-age; max_age and maxAge are accepted
as input aliases. Supplying multiple spellings of the field is an error.
These options describe requests; they do not implement caching. Hosts can
forward explicit values using max_age_option() (available with std or
clap). Execution deadlines are configured separately by
crate::TimingOptions.
Fields§
§max_age: Option<Duration>Maximum acceptable cache age (for example, 1h or 7d). Default is module-specific.
Implementations§
Source§impl CachingOptions
impl CachingOptions
Sourcepub fn builder() -> CachingOptionsBuilder
pub fn builder() -> CachingOptionsBuilder
Create an instance of CachingOptions using the builder syntax
Source§impl CachingOptions
impl CachingOptions
Sourcepub fn max_age_option(&self) -> Option<String>
Available on crate features clap or std only.
pub fn max_age_option(&self) -> Option<String>
clap or std only.Formats an explicit maximum age as one --max-age=DURATION argument.
Returns None when unset, preserving the module’s default policy.
Trait Implementations§
Source§impl Args for CachingOptions
Available on crate feature clap only.
impl Args for CachingOptions
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 CachingOptions
impl Clone for CachingOptions
Source§impl Debug for CachingOptions
impl Debug for CachingOptions
Source§impl Default for CachingOptions
impl Default for CachingOptions
Source§impl<'de> Deserialize<'de> for CachingOptions
Available on crate feature serde only.
impl<'de> Deserialize<'de> for CachingOptions
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 CachingOptions
Source§impl FromArgMatches for CachingOptions
Available on crate feature clap only.
impl FromArgMatches for CachingOptions
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 CachingOptions
impl Hash for CachingOptions
Source§impl Ord for CachingOptions
impl Ord for CachingOptions
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 CachingOptions
impl PartialEq for CachingOptions
Source§impl PartialOrd for CachingOptions
impl PartialOrd for CachingOptions
Source§impl Serialize for CachingOptions
Available on crate feature serde only.
impl Serialize for CachingOptions
serde only.