pub struct AnyScalarError {
pub source: Error,
}Expand description
Error returned by eager-tensor AnyScalar operations (autodiff, conjugation,
and complex composition).
The full original diagnostic is preserved in AnyScalarError::source, so
callers can inspect the underlying tensor, AD-runtime, or configuration
failure without losing context.
§Examples
use tensor4all_core::{AnyScalar, AnyScalarError};
let result: Result<AnyScalar, AnyScalarError> =
AnyScalar::compose_complex(AnyScalar::new_real(1.0), AnyScalar::new_complex(0.0, 1.0));
let err = result.unwrap_err();
assert!(err.source.to_string().contains("real-valued"));Fields§
§source: ErrorOriginal tensor, AD-runtime, or configuration diagnostic, including any operation-specific context added by the failing call.
Trait Implementations§
Source§impl Debug for AnyScalarError
impl Debug for AnyScalarError
Source§impl Display for AnyScalarError
impl Display for AnyScalarError
Source§impl Error for AnyScalarError
impl Error for AnyScalarError
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()
Auto Trait Implementations§
impl Freeze for AnyScalarError
impl RefUnwindSafe for AnyScalarError
impl Send for AnyScalarError
impl Sync for AnyScalarError
impl Unpin for AnyScalarError
impl UnsafeUnpin for AnyScalarError
impl UnwindSafe for AnyScalarError
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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