Enum ocl::Error
[−]
[src]
pub enum Error {
Void,
Conversion(String),
Status {
status: Status,
status_string: String,
fn_name: &'static str,
fn_info: String,
desc: String,
},
String(String),
Nul(NulError),
Io(Error),
FromUtf8Error(FromUtf8Error),
UnspecifiedDimensions,
IntoStringError(IntoStringError),
EmptyInfoResult(EmptyInfoResult),
}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
VoidConversion(String)StatusFields of Status
status: Status | |
status_string: String | |
fn_name: &'static str | |
fn_info: String | |
desc: String |
String(String)Nul(NulError)Io(Error)FromUtf8Error(FromUtf8Error)UnspecifiedDimensionsIntoStringError(IntoStringError)EmptyInfoResult(EmptyInfoResult)Methods
impl Error[src]
fn new<S>(desc: S) -> Error where
S: Into<String>,
S: Into<String>,
: Use ::from instead.
fn string<S>(desc: S) -> Error where
S: Into<String>,
S: Into<String>,
: Use ::from instead.
Returns a new Error::String with the given description.
fn err<T, S>(desc: S) -> Result<T, Error> where
S: Into<String>,
S: Into<String>,
: Use Err("...".into()) instead.
Returns a new ocl_core::Result::Err containing an
ocl_core::Error::String variant with the given description.
Depricated
Use ::err_string or Err("...".into()) instead.
fn err_string<T, S>(desc: S) -> Result<T, Error> where
S: Into<String>,
S: Into<String>,
Returns a new Err(ocl_core::Error::String(...)) variant with the
given description.
fn eval_errcode<T, S>(
errcode: i32,
result: T,
fn_name: &'static str,
fn_info: S
) -> Result<T, Error> where
S: Into<String>,
errcode: i32,
result: T,
fn_name: &'static str,
fn_info: S
) -> Result<T, Error> where
S: Into<String>,
Returns a new ocl::Result::Err containing an ocl::Error with the
given error code and description.
fn err_conversion<T, S>(desc: S) -> Result<T, Error> where
S: Into<String>,
S: Into<String>,
Returns a new ocl::Result::Err containing an
ocl::Error::Conversion variant with the given description.
fn prepend<'s, S>(&'s mut self, txt: S) where
S: AsRef<&'s str>,
S: AsRef<&'s str>,
If this is a String variant, concatenate txt to the front of the
contained string. Otherwise, do nothing at all.
fn status(&self) -> Option<Status>
Returns the error status code for Status variants.
Trait Implementations
impl Send for Error[src]
impl Display for Error[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
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 Debug for Error[src]
impl From<PlatformInfoResult> for Error[src]
fn from(err: PlatformInfoResult) -> Error
Performs the conversion.
impl From<DeviceInfoResult> for Error[src]
fn from(err: DeviceInfoResult) -> Error
Performs the conversion.
impl From<ContextInfoResult> for Error[src]
fn from(err: ContextInfoResult) -> Error
Performs the conversion.
impl From<CommandQueueInfoResult> for Error[src]
fn from(err: CommandQueueInfoResult) -> Error
Performs the conversion.
impl From<MemInfoResult> for Error[src]
fn from(err: MemInfoResult) -> Error
Performs the conversion.
impl From<ImageInfoResult> for Error[src]
fn from(err: ImageInfoResult) -> Error
Performs the conversion.
impl From<SamplerInfoResult> for Error[src]
fn from(err: SamplerInfoResult) -> Error
Performs the conversion.
impl From<ProgramInfoResult> for Error[src]
fn from(err: ProgramInfoResult) -> Error
Performs the conversion.
impl From<ProgramBuildInfoResult> for Error[src]
fn from(err: ProgramBuildInfoResult) -> Error
Performs the conversion.
impl From<KernelInfoResult> for Error[src]
fn from(err: KernelInfoResult) -> Error
Performs the conversion.
impl From<KernelArgInfoResult> for Error[src]
fn from(err: KernelArgInfoResult) -> Error
Performs the conversion.
impl From<KernelWorkGroupInfoResult> for Error[src]
fn from(err: KernelWorkGroupInfoResult) -> Error
Performs the conversion.
impl From<EventInfoResult> for Error[src]
fn from(err: EventInfoResult) -> Error
Performs the conversion.
impl From<ProfilingInfoResult> for Error[src]
fn from(err: ProfilingInfoResult) -> Error
Performs the conversion.
impl From<()> for Error[src]
impl From<EmptyInfoResult> for Error[src]
fn from(err: EmptyInfoResult) -> Error
Performs the conversion.
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.
impl From<IntoStringError> for Error[src]
fn from(err: IntoStringError) -> Error
Performs the conversion.