Struct glib::error::Error
[−]
[src]
pub struct Error(_);
A generic error capable of representing various error domains (types).
Methods
impl Error[src]
pub fn new<T: ErrorDomain>(error: T, message: &str) -> Error[src]
Creates an error with supplied error enum variant and message.
pub fn is<T: ErrorDomain>(&self) -> bool[src]
Checks if the error domain matches T.
pub fn kind<T: ErrorDomain>(&self) -> Option<T>[src]
Tries to convert to a specific error enum.
Returns Some if the error belongs to the enum's error domain and
None otherwise.
Examples
ⓘThis example is not tested
if let Some(file_error) = error.kind::<FileError>() { match file_error { FileError::Exist => ... FileError::Isdir => ... ... } }
ⓘThis example is not tested
match error { Some(FileError::Exist) => ... Some(FileError::Isdir) => ... ... }
pub fn wrap(ptr: *mut GError) -> Error[src]
Trait Implementations
impl Clone for Error[src]
fn clone(&self) -> Error[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Error[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl StaticType for Error[src]
fn static_type() -> Type[src]
Returns the type identifier of Self.
impl Send for Error[src]
impl Sync for Error[src]
impl Display for Error[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more