Struct weld::WeldError[][src]

pub struct WeldError { /* fields omitted */ }

An error when compiling or running a Weld program.

Methods

impl WeldError
[src]

Creates a new error with a message and error code.

Examples

use weld::{WeldError, WeldRuntimeErrno};

let err = WeldError::new("A new error", WeldRuntimeErrno::Unknown);

Creates a new error with a particular message and an Unknown error code.

Examples

use weld::{WeldError, WeldRuntimeErrno};

let err = WeldError::new_unknown("A new unknown error");
assert_eq!(err.code(), WeldRuntimeErrno::Unknown);

Creates a new error with a particular message indicating success.

The error returned by this function has a message "Success" and the error code WeldRuntimeErrno::Success.

Examples

use weld::{WeldError, WeldRuntimeErrno};

let err = WeldError::new_success();
assert_eq!(err.code(), WeldRuntimeErrno::Success);
assert_eq!(err.message().to_str().unwrap(), "Success");

Returns the error code of this WeldError.

Examples

use weld::{WeldError, WeldRuntimeErrno};

let err = WeldError::new("An out of memory error", WeldRuntimeErrno::OutOfMemory);
assert_eq!(err.code(), WeldRuntimeErrno::OutOfMemory);

Returns the error message of this WeldError.

Examples

use weld::{WeldError, WeldRuntimeErrno};

let err = WeldError::new("Custom error", WeldRuntimeErrno::Unknown);
assert_eq!(err.message().to_str().unwrap(), "Custom error");

Trait Implementations

impl Debug for WeldError
[src]

Formats the value using the given formatter. Read more

impl Clone for WeldError
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for WeldError
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for WeldError

impl Sync for WeldError