Skip to main content

InputResolveDefaultExt

Trait InputResolveDefaultExt 

Source
pub trait InputResolveDefaultExt<T> {
    // Required method
    fn get_from_or_default(&self, resolution: &Resolution) -> Option<T>;
}
Expand description

get_from_or_default — a separate trait because it needs T: Clone, which not every Input value type provides, the same split argenv::Input’s own impl blocks already made before this trait existed.

Required Methods§

Source

fn get_from_or_default(&self, resolution: &Resolution) -> Option<T>

Read from a resolved invocation, falling back to the declared default.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, C> InputResolveDefaultExt<T> for Input<T, C>
where T: 'static + FromRaw + Clone,