pub enum CastError {
WrongType {
dl_type: DLDataType,
rust_type: &'static str,
},
Lanes {
expected: usize,
given: usize,
},
BadAlignment {
ptr: usize,
align: usize,
rust_type: &'static str,
},
}Expand description
Error that can happen when casting a DLPack pointer to a Rust pointer
Variants§
Trait Implementations§
Source§impl Error for CastError
impl Error for CastError
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<CastError> for DLPackNDarrayError
impl From<CastError> for DLPackNDarrayError
Source§impl From<CastError> for DLPackVecError
impl From<CastError> for DLPackVecError
impl StructuralPartialEq for CastError
Auto Trait Implementations§
impl Freeze for CastError
impl RefUnwindSafe for CastError
impl Send for CastError
impl Sync for CastError
impl Unpin for CastError
impl UnwindSafe for CastError
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