Struct poem_openapi::types::ParseError
source · pub struct ParseError<T> { /* private fields */ }
Expand description
An error parsing an schema.
This type is generic over T as it uses T’s type name when converting to a regular error.
Implementations§
source§impl<T: Type> ParseError<T>
impl<T: Type> ParseError<T>
sourcepub fn expected_type(actual: Value) -> Self
pub fn expected_type(actual: Value) -> Self
The expected input type did not match the actual input type.
sourcepub fn expected_input() -> Self
pub fn expected_input() -> Self
Type A expects an input value.
sourcepub fn custom(msg: impl Display) -> Self
pub fn custom(msg: impl Display) -> Self
A custom error message.
Any type that implements Display
is automatically converted to this if
you use the ?
operator.
sourcepub fn propagate<U: Type>(self) -> ParseError<U>
pub fn propagate<U: Type>(self) -> ParseError<U>
Propagate the error message to a different type.
sourcepub fn into_message(self) -> String
pub fn into_message(self) -> String
Consume this error and convert it into a message.