Skip to main content

Visitor

Trait Visitor 

Source
pub trait Visitor<'de>: Sized {
    type Value;

Show 13 methods // Required method fn expecting(&self, f: &mut Formatter<'_>) -> Result; // Provided methods fn visit_comment<E>(self, value: &str) -> Result<Self::Value, E> where E: Error { ... } fn visit_comment_borrowed<E>( self, value: &'de str, ) -> Result<Self::Value, E> where E: Error { ... } fn visit_class<'b, A>(self, access: A) -> Result<Self::Value, A::Error> where A: ClassAccess<'de, 'b> { ... } fn visit_class_borrowed<A>(self, access: A) -> Result<Self::Value, A::Error> where A: ClassAccess<'de, 'de> { ... } fn visit_field<'b, A>(self, access: A) -> Result<Self::Value, A::Error> where A: FieldAccess<'de, 'b> { ... } fn visit_field_borrowed<A>(self, access: A) -> Result<Self::Value, A::Error> where A: FieldAccess<'de, 'de> { ... } fn visit_method<'b, A>(self, access: A) -> Result<Self::Value, A::Error> where A: MethodAccess<'de, 'b> { ... } fn visit_method_borrowed<A>( self, access: A, ) -> Result<Self::Value, A::Error> where A: MethodAccess<'de, 'de> { ... } fn visit_method_arg<'b, A>(self, access: A) -> Result<Self::Value, A::Error> where A: MethodArgAccess<'de, 'b> { ... } fn visit_method_arg_borrowed<A>( self, access: A, ) -> Result<Self::Value, A::Error> where A: MethodArgAccess<'de, 'de> { ... } fn visit_method_var<'b, A>(self, access: A) -> Result<Self::Value, A::Error> where A: MethodVarAccess<'de, 'b> { ... } fn visit_method_var_borrowed<A>( self, access: A, ) -> Result<Self::Value, A::Error> where A: MethodVarAccess<'de, 'de> { ... }
}
Expand description

Visitors for visiting a single item in a mapping file.

Required Associated Types§

Source

type Value

The returned value type.

Required Methods§

Source

fn expecting(&self, f: &mut Formatter<'_>) -> Result

Expecting item content, for error messages.

Provided Methods§

Source

fn visit_comment<E>(self, value: &str) -> Result<Self::Value, E>
where E: Error,

Visits a possibly multi-line comment.

Source

fn visit_comment_borrowed<E>(self, value: &'de str) -> Result<Self::Value, E>
where E: Error,

Visits a possibly multi-line comment with borrowed lifetime.

Never implement this method only but not visit_comment, unless the format deserializer guarantees so. By default this forwards to visit_comment.

Source

fn visit_class<'b, A>(self, access: A) -> Result<Self::Value, A::Error>
where A: ClassAccess<'de, 'b>,

Visits a class.

Source

fn visit_class_borrowed<A>(self, access: A) -> Result<Self::Value, A::Error>
where A: ClassAccess<'de, 'de>,

Visits a class with borrowed lifetime.

Never implement this method only but not visit_class, unless the format deserializer guarantees so. By default this forwards to visit_class.

Source

fn visit_field<'b, A>(self, access: A) -> Result<Self::Value, A::Error>
where A: FieldAccess<'de, 'b>,

Visits a field.

Source

fn visit_field_borrowed<A>(self, access: A) -> Result<Self::Value, A::Error>
where A: FieldAccess<'de, 'de>,

Visits a field with borrowed lifetime.

Never implement this method only but not visit_field, unless the format deserializer guarantees so. By default this forwards to visit_field.

Source

fn visit_method<'b, A>(self, access: A) -> Result<Self::Value, A::Error>
where A: MethodAccess<'de, 'b>,

Visits a method.

Source

fn visit_method_borrowed<A>(self, access: A) -> Result<Self::Value, A::Error>
where A: MethodAccess<'de, 'de>,

Visits a method argument with borrowed lifetime.

Never implement this method only but not visit_method, unless the format deserializer guarantees so. By default this forwards to visit_method.

Source

fn visit_method_arg<'b, A>(self, access: A) -> Result<Self::Value, A::Error>
where A: MethodArgAccess<'de, 'b>,

Visits a method argument.

Source

fn visit_method_arg_borrowed<A>( self, access: A, ) -> Result<Self::Value, A::Error>
where A: MethodArgAccess<'de, 'de>,

Visits a method argument with borrowed lifetime.

Never implement this method only but not visit_method_arg, unless the format deserializer guarantees so. By default this forwards to visit_method_arg.

Source

fn visit_method_var<'b, A>(self, access: A) -> Result<Self::Value, A::Error>
where A: MethodVarAccess<'de, 'b>,

Visits a method variable.

Source

fn visit_method_var_borrowed<A>( self, access: A, ) -> Result<Self::Value, A::Error>
where A: MethodVarAccess<'de, 'de>,

Visits a method variable with borrowed lifetime.

Never implement this method only but not visit_method_var, unless the format deserializer guarantees so. By default this forwards to visit_method_var.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§