pub enum VisionError {
Malformed {
detail: String,
raw: RawBytes,
},
TimedOut,
TooLarge {
limit: i64,
},
UnacceptableContentType {
content_type: String,
},
Status {
detail: String,
status: u16,
excerpt: String,
},
Unreachable {
detail: String,
},
NotConfigured {
detail: String,
},
}Expand description
Why a body could not be read, or an image could not be retrieved.
Variants§
Malformed
The body could not be read, and here it is.
Fields
TimedOut
The source took too long.
TooLarge
What arrived is larger than this port will read.
UnacceptableContentType
What arrived is a content type this port does not accept.
Status
The source answered, with a status other than success.
Carried apart from VisionError::Unreachable, because what a caller
does next depends on what was answered: a camera answering 500 is a
camera that may answer the next request, and one answering 404 was
asked for something it does not have.
Fields
excerpt: StringThe start of the body it answered with, as text: at most
STATUS_EXCERPT_MAX_BYTES of it, read by body_excerpt.
Unreachable
The source could not be reached at all.
NotConfigured
The adapter was given nothing to reach the provider with for this.
Implementations§
Source§impl VisionError
impl VisionError
Sourcepub const fn is_server_error(&self) -> bool
pub const fn is_server_error(&self) -> bool
Whether the source answered a server error, 500 to 599: the one
answer a fetch may be asked again for, because it says the source is
there and could not answer this time.
Trait Implementations§
Source§impl Clone for VisionError
impl Clone for VisionError
Source§impl Debug for VisionError
impl Debug for VisionError
Source§impl Display for VisionError
impl Display for VisionError
impl Eq for VisionError
Source§impl Error for VisionError
impl Error for VisionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()