[−][src]Enum milter::Error
Various kinds of errors that can occur in a milter application.
Variants
SocketConfig(CString)
The socket specification provided to the Milter
could not be used.
TimeoutConfig(i32)
The timeout duration configuration parameter of the Milter
is invalid.
SocketBacklogConfig(i32)
The socket backlog length configuration parameter of the Milter
is
invalid.
Registration of the milter’s configuration with the milter library failed.
The milter library’s event loop (main
function) exited with a failure
status.
The milter library’s event loop was shut down after a panic in a callback.
A milter library function returned the failure status code.
FfiCString(NulError)
Conversion to a C-style string at the FFI boundary (Rust/C) failed, with cause attached.
FfiInt(TryFromIntError)
Conversion to an integer type at the FFI boundary (Rust/C) failed, with cause attached.
FfiUtf8(Utf8Error)
Conversion to a UTF-8 string at the FFI boundary (Rust/C) failed, with cause attached.
DataAccess(BorrowError)
Erroneous immutable access of context data (violation of dynamic borrowing rules), with cause attached.
DataAccessMut(BorrowMutError)
Erroneous mutable access of context data (violation of dynamic borrowing rules), with cause attached.
An unspecific error variant, with cause attached.
Examples
This variant is provided as a convenience; use it to propagate arbitrary errors out of a callback.
use milter::{Context, Error, Status}; use std::fs::File; fn handle_data(context: Context<()>) -> milter::Result<Status> { let _ = File::create("/tmp/archive").map_err(|e| Error::Custom(e.into()))?; Ok(Status::Continue) }
Trait Implementations
impl From<NulError> for Error
[src]
impl From<TryFromIntError> for Error
[src]
fn from(error: TryFromIntError) -> Self
[src]
impl From<Utf8Error> for Error
[src]
impl From<BorrowError> for Error
[src]
fn from(error: BorrowError) -> Self
[src]
impl From<BorrowMutError> for Error
[src]
fn from(error: BorrowMutError) -> Self
[src]
impl From<Box<dyn Error + 'static + Sync + Send>> for Error
[src]
impl Display for Error
[src]
impl Debug for Error
[src]
impl Error for Error
[src]
Auto Trait Implementations
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
impl !RefUnwindSafe for Error
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,