pub struct ErrorMigrationHelper;Expand description
Migration utilities for common error patterns
Implementations§
Source§impl ErrorMigrationHelper
impl ErrorMigrationHelper
Sourcepub fn shape_error(
expected: Vec<usize>,
actual: Vec<usize>,
operation: &str,
) -> TrustformersError
pub fn shape_error( expected: Vec<usize>, actual: Vec<usize>, operation: &str, ) -> TrustformersError
Convert legacy shape error pattern to new system
Sourcepub fn tensor_operation_error(
operation: &str,
reason: &str,
component: &str,
) -> TrustformersError
pub fn tensor_operation_error( operation: &str, reason: &str, component: &str, ) -> TrustformersError
Convert legacy tensor operation error to new system
Sourcepub fn memory_allocation_error(
reason: &str,
operation: &str,
) -> TrustformersError
pub fn memory_allocation_error( reason: &str, operation: &str, ) -> TrustformersError
Convert legacy memory error to new system
Convert legacy hardware error to new system
Sourcepub fn invalid_configuration_error(
field: &str,
reason: &str,
component: &str,
) -> TrustformersError
pub fn invalid_configuration_error( field: &str, reason: &str, component: &str, ) -> TrustformersError
Convert legacy configuration error to new system
Auto Trait Implementations§
impl Freeze for ErrorMigrationHelper
impl RefUnwindSafe for ErrorMigrationHelper
impl Send for ErrorMigrationHelper
impl Sync for ErrorMigrationHelper
impl Unpin for ErrorMigrationHelper
impl UnsafeUnpin for ErrorMigrationHelper
impl UnwindSafe for ErrorMigrationHelper
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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