pub enum LayoutError {
NonContiguous {
operation: String,
layout_type: String,
},
DimensionMismatch {
expected_dims: String,
actual_dims: String,
operation: String,
},
BorrowedDataMutation {
operation: String,
reason: String,
},
EmptyData {
operation: String,
},
IncompatibleFormat {
operation: String,
reason: String,
},
ShapeError {
operation: String,
info: String,
},
}Expand description
Errors related to memory layout, array structure, and data organization.
This covers failures related to array contiguity, dimension mismatches, borrowed data mutation attempts, and other structural issues.
Variants§
NonContiguous
Array data is not contiguous in memory when contiguous layout is required.
Fields
DimensionMismatch
Array dimensions don’t match expected values for the operation.
Fields
BorrowedDataMutation
Attempted to modify borrowed audio data that should be immutable.
Fields
EmptyData
Input data is empty when the operation requires non-empty data.
IncompatibleFormat
Data size or format is incompatible with the operation requirements.
Fields
ShapeError
A shape-related error occurred during array operations.
Implementations§
Source§impl LayoutError
impl LayoutError
Sourcepub fn borrowed_mutation<O, R>(operation: O, reason: R) -> Self
pub fn borrowed_mutation<O, R>(operation: O, reason: R) -> Self
Create a new borrowed data mutation error.
Sourcepub fn dimension_mismatch<E, A, O>(expected: E, actual: A, operation: O) -> Self
pub fn dimension_mismatch<E, A, O>(expected: E, actual: A, operation: O) -> Self
Create a new dimension mismatch error.
Sourcepub fn empty_data<O>(operation: O) -> Selfwhere
O: ToString,
pub fn empty_data<O>(operation: O) -> Selfwhere
O: ToString,
Create a new empty data error.
Trait Implementations§
Source§impl Clone for LayoutError
impl Clone for LayoutError
Source§fn clone(&self) -> LayoutError
fn clone(&self) -> LayoutError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutError
impl Debug for LayoutError
Source§impl Display for LayoutError
impl Display for LayoutError
Source§impl Error for LayoutError
impl Error for LayoutError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<LayoutError> for AudioSampleError
impl From<LayoutError> for AudioSampleError
Source§fn from(source: LayoutError) -> Self
fn from(source: LayoutError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LayoutError
impl RefUnwindSafe for LayoutError
impl Send for LayoutError
impl Sync for LayoutError
impl Unpin for LayoutError
impl UnwindSafe for LayoutError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more