#[non_exhaustive]pub enum Error {
Os(Result),
Libc(String),
ServiceAlreadyActive,
OutputAlreadyRedirected,
BufferTooShort {
provided: usize,
wanted: usize,
},
Other(String),
}
Expand description
The generic error enum returned by ctru-rs
functions.
This error enum supports parsing and displaying ctru_sys::Result
codes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Os(Result)
Raw ctru_sys::Result
codes.
Libc(String)
Generic [libc
] errors.
ServiceAlreadyActive
Requested service is already active and cannot be activated again.
OutputAlreadyRedirected
stdout
is already being redirected.
BufferTooShort
Fields
§
provided: usize
Length of the buffer provided by the user.
§
wanted: usize
Size of the requested data (in bytes).
The buffer provided by the user to store some data is shorter than required.
Other(String)
An error that doesn’t fit into the other categories.
Implementations§
source§impl Error
impl Error
sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Check if the error is a timeout.
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ResultCode> for Error
impl From<ResultCode> for Error
source§fn from(err: ResultCode) -> Self
fn from(err: ResultCode) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more