[−][src]Trait status::Kind
Trait alias for types that programmatically specify the status.
For prototyping, see Unkind
.
Example
use status::Kind; #[derive(Copy, Clone, Debug, derive_more::Display)] enum ErrorKind { #[display(fmt = "Failed to read file")] Read, #[display(fmt = "Failed to parse")] Parse, } type Status = status::Status<ErrorKind>; type Result<T, E = Status> = std::result::Result<T, E>; fn read_file() -> Result<()> { return ErrorKind::Read.into_err(); }
Provided methods
fn into_status<C: Context>(self) -> Status<Self, C>
Convenience for creating an error.
fn into_err<T, C: Context>(self) -> Result<T, Status<Self, C>>
Convenience for returning an error.