pub enum StreamError {
Show 17 variants
Io {
operation: String,
source: Error,
},
File {
path: PathBuf,
operation: FileOperation,
source: Error,
},
Network {
address: String,
operation: NetworkOperation,
source: Error,
},
Process {
command: String,
operation: ProcessOperation,
source: Error,
},
Stream {
operation: StreamOperation,
source: Error,
},
Codec {
codec_name: String,
position: Option<u64>,
source: Box<dyn Error + Send + Sync>,
},
Limit {
limit_type: LimitType,
actual: u64,
max_allowed: u64,
},
Timeout {
operation: String,
duration: Duration,
},
Http {
source: Error,
},
ContentType {
path: Option<PathBuf>,
extension: Option<String>,
reason: String,
},
Conversion {
from_type: String,
to_type: String,
reason: String,
},
Custom {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Json {
source: Error,
},
Url {
source: ParseError,
},
Utf8 {
source: Utf8Error,
},
EndOfStream,
Cancelled,
}Variants§
Io
File
Network
Process
Stream
Codec
Limit
Timeout
Http
ContentType
Conversion
Custom
Json
Url
Fields
§
source: ParseErrorUtf8
EndOfStream
Cancelled
Implementations§
Source§impl StreamError
impl StreamError
pub fn io_error<O: Into<String>>(operation: O, source: Error) -> Self
pub fn file_error<P: Into<PathBuf>>( path: P, operation: FileOperation, source: Error, ) -> Self
pub fn network_error<A: Into<String>>( address: A, operation: NetworkOperation, source: Error, ) -> Self
pub fn timeout_error<O: Into<String>>(operation: O, duration: Duration) -> Self
pub fn custom<M: Into<String>>(message: M) -> Self
pub fn size_limit_error( limit_type: LimitType, actual: u64, max_allowed: u64, ) -> Self
pub fn is_recoverable(&self) -> bool
pub fn is_temporary(&self) -> bool
Trait Implementations§
Source§impl Debug for StreamError
impl Debug for StreamError
Source§impl Display for StreamError
impl Display for StreamError
Source§impl Error for StreamError
impl Error for StreamError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for StreamError
impl From<Error> for StreamError
Source§impl From<Error> for StreamError
impl From<Error> for StreamError
Source§impl From<Error> for StreamError
impl From<Error> for StreamError
Source§impl From<ParseError> for StreamError
impl From<ParseError> for StreamError
Source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StreamError
impl !RefUnwindSafe for StreamError
impl Send for StreamError
impl Sync for StreamError
impl Unpin for StreamError
impl !UnwindSafe for StreamError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.