Struct pam_client::ErrorWith [−][src]
Base error type for PAM operations (possibly with a payload)
Errors originate from the PAM library, PAM modules or helper structs in this crate. Currently no custom instances are supported.
Implementations
impl<T> ErrorWith<T>[src]
pub fn with_payload(
handle: &mut PamHandle,
code: ReturnCode,
payload: Option<T>
) -> ErrorWith<T>[src]
handle: &mut PamHandle,
code: ReturnCode,
payload: Option<T>
) -> ErrorWith<T>
Creates a new Error that takes a payload.
Functions that consume a struct can use the payload to transfer back ownership in error cases.
pub const fn code(&self) -> ReturnCode[src]
The error code.
pub fn message(&self) -> Option<&str>[src]
Text representation of the error code, if available.
pub const fn payload(&self) -> Option<&T>[src]
Returns a reference to an optional payload.
pub fn take_payload(&mut self) -> Option<T>[src]
Takes the payload out of the error message.
If a payload exists in this error, it will be moved into the returned
Option. All further calls to payload() and
take_payload() will return None.
pub fn drop_payload(self) -> Error[src]
Drops any payload off the error message, if one exists.
pub fn map<U>(self, func: impl FnOnce(T) -> U) -> ErrorWith<U>[src]
impl ErrorWith<NoPayload>[src]
pub fn new(handle: &mut PamHandle, code: ReturnCode) -> Error[src]
Creates a new Error.
pub fn into_with_payload<T>(self, payload: T) -> ErrorWith<T>[src]
Adds the payload to the error message and returns a corresponding
ErrorWith<T> instance.
pub fn into<T>(self) -> ErrorWith<T>[src]
Converts the error message into a ErrorWith<T> instance without
a payload.
Trait Implementations
impl<T: Clone> Clone for ErrorWith<T>[src]
impl<T> Debug for ErrorWith<T>[src]
impl<T> Display for ErrorWith<T>[src]
impl<T> Eq for ErrorWith<T> where
T: Eq, [src]
T: Eq,
impl<T> Error for ErrorWith<T>[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>[src]
pub fn description(&self) -> &str1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>1.0.0[src]
impl<T> Hash for ErrorWith<T> where
T: Hash, [src]
T: Hash,
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<T> PartialEq<ErrorWith<T>> for ErrorWith<T> where
T: PartialEq, [src]
T: PartialEq,
Auto Trait Implementations
impl<T> RefUnwindSafe for ErrorWith<T> where
T: RefUnwindSafe, [src]
T: RefUnwindSafe,
impl<T> Send for ErrorWith<T> where
T: Send, [src]
T: Send,
impl<T> Sync for ErrorWith<T> where
T: Sync, [src]
T: Sync,
impl<T> Unpin for ErrorWith<T> where
T: Unpin, [src]
T: Unpin,
impl<T> UnwindSafe for ErrorWith<T> where
T: UnwindSafe, [src]
T: UnwindSafe,
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>,