pub trait SameOrElseExtwhere
Self: Eq,{
// Required method
fn same_or_else(self, _: Self, _: impl FnOnce() -> Self) -> Self;
}Required Methods§
Sourcefn same_or_else(self, _: Self, _: impl FnOnce() -> Self) -> Self
fn same_or_else(self, _: Self, _: impl FnOnce() -> Self) -> Self
Check if self and other are equal, if so, return self, otherwise return the result of f().
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.