[][src]Trait destream::de::Expected

pub trait Expected {
    pub fn fmt(&self, formatter: &mut Formatter<'_>) -> Result;
}

Expected represents an explanation of what data a Visitor was expecting to receive.

This is used as an argument to the invalid_type, invalid_value, and invalid_length methods of the Error trait to build error messages. The message should be a noun or noun phrase that completes the sentence "This Visitor expects to receive ...", for example the message could be "an integer between 0 and 64". The message should not be capitalized and should not end with a period.

Within the context of a Visitor implementation, the Visitor itself (&self) is an implementation of this trait.

Required methods

pub fn fmt(&self, formatter: &mut Formatter<'_>) -> Result[src]

Format an explanation of what data was being expected. Same signature as the Display and Debug traits.

Loading content...

Trait Implementations

impl<'a> Display for dyn Expected + 'a[src]

Implementations on Foreign Types

impl Expected for str[src]

impl Expected for &'static str[src]

impl Expected for String[src]

Loading content...

Implementors

impl<V: Visitor> Expected for V[src]

Loading content...