Struct spinoso_env::InvalidError [−][src]
Error that indicates the underlying platform API returned an error.
This error is typically returned by the operating system and corresponds to
EINVAL
.
Examples
let err = InvalidError::new(); assert_eq!(err.message(), b"Errno::EINVAL"); let err = InvalidError::with_message("Invalid argument - setenv()"); assert_eq!(err.message(), b"Invalid argument - setenv()");
Implementations
impl InvalidError
[src]
#[must_use]pub const fn new() -> Self
[src]
Construct a new, default invalid error.
Examples
const ERR: InvalidError = InvalidError::new(); assert_eq!(ERR.message(), b"Errno::EINVAL");
#[must_use]pub const fn with_message(message: &'static str) -> Self
[src]
Construct a new, invalid error with a message.
Examples
const ERR: InvalidError = InvalidError::with_message("Invalid argument - setenv()"); assert_eq!(ERR.message(), b"Invalid argument - setenv()");
#[must_use]pub fn message(&self) -> &[u8]
[src]
Retrieve the exception message associated with this invalid error.
Examples
let err = InvalidError::new(); assert_eq!(err.message(), b"Errno::EINVAL");
#[must_use]pub fn into_message(self) -> Cow<'static, [u8]>
[src]
Consume this error and return the inner message.
This method allows taking ownership of this error’s message without an allocation.
Examples
let err = InvalidError::new(); assert_eq!(err.into_message(), Cow::Borrowed(b"Errno::EINVAL"));
Trait Implementations
impl Clone for InvalidError
[src]
fn clone(&self) -> InvalidError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for InvalidError
[src]
impl Display for InvalidError
[src]
impl Eq for InvalidError
[src]
impl Error for InvalidError
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<&'static [u8]> for InvalidError
[src]
fn from(message: &'static [u8]) -> Self
[src]
impl From<&'static str> for InvalidError
[src]
impl From<InvalidError> for Error
[src]
fn from(err: InvalidError) -> Self
[src]
impl From<Vec<u8, Global>> for InvalidError
[src]
impl Hash for InvalidError
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for InvalidError
[src]
fn cmp(&self, other: &InvalidError) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<InvalidError> for InvalidError
[src]
fn eq(&self, other: &InvalidError) -> bool
[src]
fn ne(&self, other: &InvalidError) -> bool
[src]
impl PartialOrd<InvalidError> for InvalidError
[src]
fn partial_cmp(&self, other: &InvalidError) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for InvalidError
[src]
impl StructuralPartialEq for InvalidError
[src]
Auto Trait Implementations
impl RefUnwindSafe for InvalidError
impl Send for InvalidError
impl Sync for InvalidError
impl Unpin for InvalidError
impl UnwindSafe for InvalidError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,