Enum ocl_core::error::Error
[−]
[src]
pub enum Error { Conversion(String), Status { status: Status, fn_name: &'static str, fn_info: String, desc: String, }, String(String), Nul(NulError), Io(Error), FromUtf8Error(FromUtf8Error), UnspecifiedDimensions, }
An enum containing either a String
or one of several other error types.
Implements the usual error traits.
Stability
The String
variant may eventually be removed. Many more variants and
sub-types will be added as time goes on and things stabilize.
Status
will eventually be changed internally to contain a sub-error type
unique to each function which generates it (yeah that'll be fun to
implement).
UnspecifiedDimensions
may be moved into a sub-type.
For now, don't assume the existence of or check for any of the above.
Variants
Conversion(String)
Status
Fields
status: Status | |
fn_name: &'static str | |
fn_info: String | |
desc: String |
String(String)
Nul(NulError)
Io(Error)
FromUtf8Error(FromUtf8Error)
UnspecifiedDimensions
Methods
impl Error
[src]
fn new<S: Into<String>>(desc: S) -> Error
Returns a new Error
with the description string: desc
.
fn err<T, S: Into<String>>(desc: S) -> Result<T>
Returns a new ocl::Result::Err
containing an ocl::Error::String
variant with the given description.
fn err_status<T: Default, S: Into<String>>(errcode: i32, fn_name: &'static str, fn_info: S) -> Result<T>
Returns a new ocl::Result::Err
containing an ocl::Error
with the
given error code and description.
fn err_conversion<T, S: Into<String>>(desc: S) -> Result<T>
Returns a new ocl::Result::Err
containing an
ocl::Error::Conversion
variant with the given description.
fn prepend<'s, S: AsRef<&'s str>>(&'s mut self, txt: S)
If this is a String
variant, concatenate txt
to the front of the
contained string. Otherwise, do nothing at all.
fn status_code(&self) -> String
Returns the error status const code name or nothing.
fn status(&self) -> Option<Status>
Returns the error status code for Status
variants.
Trait Implementations
impl Debug for Error
[src]
impl Error for Error
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0
The lower-level cause of this error, if any. Read more
impl Into<String> for Error
[src]
impl From<String> for Error
[src]
impl<'a> From<&'a str> for Error
[src]
impl From<NulError> for Error
[src]
impl From<Error> for Error
[src]
impl From<FromUtf8Error> for Error
[src]
fn from(err: FromUtf8Error) -> Error
Performs the conversion.