Struct glib::Error [] [src]

pub struct Error {
    // some fields omitted
}

The Error structure contains information about an error that has occurred.

Methods

impl Error

fn new_literal(domain: GQuark, code: i32, message: &str) -> Option<Error>

Creates a new Error; unlike Error::new(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

fn release(&mut self)

Frees an Error struct and associated resources.

fn matches(&self, domain: GQuark, code: i32) -> bool

Returns true if error matches domain and code , false otherwise. In particular, when error.pointer is NULL, false will be returned.

If domain contains a FAILED (or otherwise generic) error code, you should generally not check for it explicitly, but should instead treat any not-explicitly-recognized error code as being equivalent to the FAILED code. This way, if the domain is extended in the future to provide a more specific error code for a certain case, your code will still work.

fn set(&mut self, domain: GQuark, code: i32, message: &str)

Does nothing if self.pointer is NULL; if self.pointer is non-NULL, then *self.pointer must be NULL. A new GError is created and assigned to *self.pointer .

fn propagate(&mut self, other: &Error)

If other.pointer is NULL, free self ; otherwise, moves self into other. The error variable other.pointer points to must be NULL.

Note that self is no longer valid after this call. If you want to keep using the same Error struct, you need to set it to NULL after calling this function on it.

fn message(&self) -> &str

Returns the error message stored in the wrapped GError

Trait Implementations

impl Clone for Error

fn clone(&self) -> Error

fn clone_from(&mut self, source: &Self)

impl Debug for Error

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for Error

fn fmt(&self, f: &mut Formatter) -> Result

impl Error for Error

fn description(&self) -> &str

fn cause(&self) -> Option<&Error>

impl Drop for Error

fn drop(&mut self)

impl GlibContainer<*mut GError> for Error

fn wrap(pointer: *mut GError) -> Error

fn unwrap(&self) -> *mut GError