Struct spirit::validation::Result

source ·
pub struct Result { /* private fields */ }
Expand description

A validation result.

The validator (see config_validator) is supposed to return an arbitrary number of these results. Each one can hold a message (with varying severity) and optionally a success and failure actions.

Implementations§

Creates a result with given level and message.

Creates a result without any message.

Creates a result with a hint.

Creates a result with a warning.

Creates an error result.

An error result not only gets to the logs, it also marks the whole config as invalid.

Creates an error result from an actual Error.

The error then is logged with additional information.

Returns the result’s level.

Returns the message texts.

Returns an associated error if there’s one.

Note that the error text is already part of the description.

Attaches (replaces) the success action.

Attaches (replaces) the failure action.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.