pub struct PassSpec {
pub name: &'static str,
pub options: &'static [OptionSpec],
pub make: fn(&Given<'_>) -> Result<Box<dyn Pass>, String>,
}Expand description
A pass as the registry knows it: its name, the options it takes, and how it is made from what the declaration let through.
Fields§
§name: &'static str§options: &'static [OptionSpec]§make: fn(&Given<'_>) -> Result<Box<dyn Pass>, String>Implementations§
Source§impl PassSpec
impl PassSpec
Sourcepub fn requires_options(&self) -> bool
pub fn requires_options(&self) -> bool
Whether a pipeline must give it options: a required option or a one-of group.
Sourcepub fn example(&self) -> Options
pub fn example(&self) -> Options
The options it is made with to read its declarations: each required option’s example and the first option’s of each group.
Sourcepub fn check(&self, options: &Options) -> Result<(), String>
pub fn check(&self, options: &Options) -> Result<(), String>
options against the declaration: the refusal of the first undeclared key, missing required option, one-of
group given none or more than one of, or choice value outside its values.
Trait Implementations§
Auto Trait Implementations§
impl Forget for PassSpec
impl Freeze for PassSpec
impl RefUnwindSafe for PassSpec
impl Send for PassSpec
impl Sync for PassSpec
impl Unpin for PassSpec
impl UnsafeUnpin for PassSpec
impl UnwindSafe for PassSpec
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