pub trait TrySub: Sized {
// Required method
fn try_sub(&self, other: &Self) -> Result<Self, Error>;
}
Expand description
A trait for types that support fallible subtraction
This trait is similar to the standard Sub
trait, but returns a Result
to handle cases where subtraction might fail.
§Type Parameters
Sized
- Required to ensure the type can be used by value
Required Methods§
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.