WithinRepeatLevel

Trait WithinRepeatLevel 

Source
pub trait WithinRepeatLevel<'w>: 'w {
    // Required methods
    fn level_display_name() -> &'static str;
    fn current(ctx: &'w Context<'_>) -> Option<&'w Self>;
    fn for_each<'c, F, E>(ctx: &'c Context<'c>, call: F) -> Result<(), E>
       where F: FnMut(&Context<'_>, &Self) -> Result<(), E>,
             'c: 'w;

    // Provided method
    fn missing_repeat_level_special_error(
        _ctx: &'w Context<'_>,
        _span: Span,
    ) -> Option<Error> { ... }
}
Expand description

Implemented for WithinVariant and WithinField

For combining code that applies similarly for different repeat levels.

Required Methods§

Source

fn level_display_name() -> &'static str

Source

fn current(ctx: &'w Context<'_>) -> Option<&'w Self>

Source

fn for_each<'c, F, E>(ctx: &'c Context<'c>, call: F) -> Result<(), E>
where F: FnMut(&Context<'_>, &Self) -> Result<(), E>, 'c: 'w,

Iterate over all the things at this level

If it needs a current container of the next level up (eg, a field needing a variant) and there is none current, iterates over containing things too.

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§