WaveletError

Enum WaveletError 

Source
pub enum WaveletError {
    InvalidLength {
        expected: usize,
        actual: usize,
        context: String,
    },
    SignalTooShort {
        minimum: usize,
        actual: usize,
        operation: String,
    },
    InvalidParameter {
        parameter: String,
        value: String,
        reason: String,
    },
    AllocationError {
        size: usize,
        alignment: usize,
        context: String,
    },
    TransformError {
        transform_type: String,
        reason: String,
    },
    IoError {
        path: Option<String>,
        operation: String,
        reason: String,
    },
    InvalidDecompositionLevel {
        requested: usize,
        maximum: usize,
    },
    BoundaryError {
        mode: String,
        reason: String,
    },
    ReconstructionError {
        reason: String,
    },
    NumericError {
        operation: String,
        detail: String,
    },
    NotImplemented {
        feature: String,
    },
    Generic {
        message: String,
        context: Option<String>,
    },
}
Expand description

Main error type for the wavelet library

Variants§

§

InvalidLength

Invalid signal length for the operation

Fields

§expected: usize
§actual: usize
§context: String
§

SignalTooShort

Signal is too short for the requested operation

Fields

§minimum: usize
§actual: usize
§operation: String
§

InvalidParameter

Invalid parameter value

Fields

§parameter: String
§value: String
§reason: String
§

AllocationError

Memory allocation error

Fields

§size: usize
§alignment: usize
§context: String
§

TransformError

Transform error

Fields

§transform_type: String
§reason: String
§

IoError

IO error

Fields

§operation: String
§reason: String
§

InvalidDecompositionLevel

Decomposition level error

Fields

§requested: usize
§maximum: usize
§

BoundaryError

Boundary handling error

Fields

§mode: String
§reason: String
§

ReconstructionError

Reconstruction error

Fields

§reason: String
§

NumericError

Numeric overflow or underflow

Fields

§operation: String
§detail: String
§

NotImplemented

Feature not yet implemented

Fields

§feature: String
§

Generic

Generic error with context

Fields

§message: String
§context: Option<String>

Implementations§

Source§

impl WaveletError

Source

pub fn invalid_length( expected: usize, actual: usize, context: impl Into<String>, ) -> Self

Create an InvalidLength error with context

Source

pub fn signal_too_short( minimum: usize, actual: usize, operation: impl Into<String>, ) -> Self

Create a SignalTooShort error

Source

pub fn invalid_parameter( parameter: impl Into<String>, value: impl Display, reason: impl Into<String>, ) -> Self

Create an InvalidParameter error

Source

pub fn allocation_error( size: usize, alignment: usize, context: impl Into<String>, ) -> Self

Create an AllocationError

Source

pub fn transform_error( transform_type: impl Into<String>, reason: impl Into<String>, ) -> Self

Create a TransformError

Source

pub fn io_error(operation: impl Into<String>, reason: impl Into<String>) -> Self

Create an IoError

Source

pub fn io_error_with_path( path: impl Into<String>, operation: impl Into<String>, reason: impl Into<String>, ) -> Self

Create an IoError with a path

Source

pub fn not_implemented(feature: impl Into<String>) -> Self

Create a NotImplemented error

Source

pub fn generic(message: impl Into<String>) -> Self

Create a Generic error

Source

pub fn generic_with_context( message: impl Into<String>, context: impl Into<String>, ) -> Self

Create a Generic error with context

Source

pub fn with_context(self, context: impl Into<String>) -> Self

Add context to any error

Trait Implementations§

Source§

impl Clone for WaveletError

Source§

fn clone(&self) -> WaveletError

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
Source§

impl Debug for WaveletError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for WaveletError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for WaveletError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

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

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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
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.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V