Skip to main content

DoForAttrs

Trait DoForAttrs 

Source
pub trait DoForAttrs<'a, S: DoForAttrsStrategy<'a>> {
    // Required method
    fn do_for_attrs(
        &'a self,
        inputs: &S::Inputs,
        outputs: &mut S::Outputs,
    ) -> Result<(), S::Error>;
}
Expand description

This trait is implemented for all blocks.

For blocks a generic implementation will call DoForAttrs::do_for_attrs for all attributes of the block variant at hand in the order they stand in the source file. Every attribute may modify the value of outputs.

For every kind of traversal the trait needs to be implemented for all attribute types. That are many but it is easier than implementing it for all occurences of an attribute in block variants separately.

Required Methods§

Source

fn do_for_attrs( &'a self, inputs: &S::Inputs, outputs: &mut S::Outputs, ) -> Result<(), S::Error>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for BlockKind

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for CmpBlockKind

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for EventBlockKind

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for ExprBlockKind

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for ExprOrCmpBlockKind

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for ProceduresDefinition

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for ProceduresPrototype

Source§

impl<'a, S: DoForAttrsStrategy<'a>> DoForAttrs<'a, S> for StmtBlockKind