pub trait WithContext<T> {
// Required methods
fn with_context<F>(self, f: F) -> Result<T, RusTorchError>
where F: FnOnce() -> ErrorContext;
fn with_operation(self, operation: &str) -> Result<T, RusTorchError>;
}Expand description
Trait for adding context to errors エラーにコンテキストを追加するトレイト
Required Methods§
Sourcefn with_context<F>(self, f: F) -> Result<T, RusTorchError>where
F: FnOnce() -> ErrorContext,
fn with_context<F>(self, f: F) -> Result<T, RusTorchError>where
F: FnOnce() -> ErrorContext,
Add context to the error エラーにコンテキストを追加
Sourcefn with_operation(self, operation: &str) -> Result<T, RusTorchError>
fn with_operation(self, operation: &str) -> Result<T, RusTorchError>
Add simple operation context 簡単な操作コンテキストを追加
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.