schemars::gen

Trait GenVisitor

Source
pub trait GenVisitor:
    Visitor
    + Debug
    + DynClone
    + Any {
    // Required method
    fn as_any(&self) -> &dyn Any;
}
Expand description

A Visitor which implements additional traits required to be included in a SchemaSettings.

You will rarely need to use this trait directly as it is automatically implemented for any type which implements all of:

§Example

use schemars::visit::Visitor;
use schemars::gen::GenVisitor;

#[derive(Debug, Clone)]
struct MyVisitor;

impl Visitor for MyVisitor { }

let v: &dyn GenVisitor = &MyVisitor;
assert!(v.as_any().is::<MyVisitor>());

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Upcasts this visitor into an Any, which can be used to inspect and manipulate it as its concrete type.

Trait Implementations§

Source§

impl<'clone> Clone for Box<dyn GenVisitor + 'clone>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone> Clone for Box<dyn GenVisitor + Send + 'clone>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone> Clone for Box<dyn GenVisitor + Send + Sync + 'clone>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'clone> Clone for Box<dyn GenVisitor + Sync + 'clone>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

Source§

impl<T> GenVisitor for T
where T: Visitor + Debug + Clone + Any,