Enum ErrorKind

pub enum ErrorKind {
    CriticalError {
        kind: ExecutionStatusKind,
        msg: Option<KanziString>,
    },
    StaleObject,
    ObjectNotFound,
    InvalidArgument,
    TypeMismatch,
    IndexOutofBounds,
}

Variants§

§

CriticalError

All exceptions from Kanzi are converted into CriticalError. Users are expected to propagate these errors to the top level, as Kanzi may be left in an undefined state after an exception, making continued execution of Kanzi potentially unsafe.

Fields

§kind: ExecutionStatusKind

Used to provide more descriptive error messages. Matches an exception type caught by the bridge layer.

§msg: Option<KanziString>

Used to provide more descriptive error messages. Optional error message extracted from a C++ exception with what() method.

§

StaleObject

The weak reference to the Kanzi object is no longer valid. The execution may continue.

§

ObjectNotFound

The requested property or object could not be found. The execution may continue.

§

InvalidArgument

The provided argument was not expected. The execution may continue.

§

TypeMismatch

Function succeeded and the object was returned, yet, downcasting it to a specified type failed. The execution may continue.

§

IndexOutofBounds

The provided index is out of bounds. The execution may continue.

Implementations§

§

impl ErrorKind

pub const fn as_sys_kind(&self) -> ExecutionStatusKind

Trait Implementations§

§

impl Clone for ErrorKind

§

fn clone(&self) -> ErrorKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl Debug for ErrorKind

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for ErrorKind

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

let error = Error::critical_error("Couldn't find provided URL");
assert_eq!(
    error.kind.to_string(),
    "CriticalError (Unknown): Couldn't find provided URL",
);

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Inherits<T> for T

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.