[−][src]Struct weld::WeldError
An error when compiling or running a Weld program.
Methods
impl WeldError
[src]
pub fn new<T: Into<Vec<u8>>>(message: T, code: WeldRuntimeErrno) -> 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);
pub fn new_unknown<T: Into<Vec<u8>>>(message: T) -> WeldError
[src]
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);
pub fn new_success() -> WeldError
[src]
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");
pub fn code(&self) -> WeldRuntimeErrno
[src]
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);
pub fn message(&self) -> &CStr
[src]
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
Auto Trait Implementations
impl RefUnwindSafe for WeldError
impl Send for WeldError
impl Sync for WeldError
impl Unpin for WeldError
impl UnwindSafe for WeldError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,