1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use std::result;
use engine_shared::TypeMismatch;
use types::CLValueError;
#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Hash, Debug)]
pub struct Error {
inner: String,
}
impl From<String> for Error {
fn from(error: String) -> Self {
Error { inner: error }
}
}
impl From<CLValueError> for Error {
fn from(error: CLValueError) -> Self {
Error {
inner: format!("{:?}", error),
}
}
}
impl From<TypeMismatch> for Error {
fn from(error: TypeMismatch) -> Self {
Error {
inner: format!("{:?}", error),
}
}
}
pub type Result<T> = result::Result<T, Error>;