Skip to main content

VisitorMut

Trait VisitorMut 

Source
pub trait VisitorMut {
    // Required method
    fn leaf(
        &mut self,
        path: &str,
        array: &mut Array,
        kind: LeafKind,
        frozen: Option<&mut bool>,
    );

    // Provided methods
    fn paths(&self) -> bool { ... }
    fn child(&mut self, path: &str, child: &mut dyn Any) -> bool { ... }
    fn training(&mut self, path: &str, flag: &mut bool) { ... }
}
Expand description

Receives what a VisitMut reports, with full paths.

Required Methods§

Source

fn leaf( &mut self, path: &str, array: &mut Array, kind: LeafKind, frozen: Option<&mut bool>, )

A leaf, mutably: its array, kind and, for a parameter, its frozen flag.

Provided Methods§

Source

fn paths(&self) -> bool

Whether the visitor reads paths (true by default); see Visitor::paths.

Source

fn child(&mut self, path: &str, child: &mut dyn Any) -> bool

A child tree at path, as &mut dyn Any (to find or replace submodules of a given type); returns whether to visit inside it (the default).

Source

fn training(&mut self, path: &str, flag: &mut bool)

A mode flag (train/eval), mutably.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§