pub trait PostfixAssertOption: Sealed {
// Required methods
fn assert_some(self) -> Self;
fn assert_none(self) -> Self;
}Expand description
Describes the assert_* methods for std::option::Option<T>
This trait is sealed to allow for additional assertion methods in the future. As such, this trait cannot be implemented by the user.
Required Methods§
Sourcefn assert_some(self) -> Self
fn assert_some(self) -> Self
This checks the Option given and panics if it is not a Some(T). Otherwise it just returns the option back to you.
Sourcefn assert_none(self) -> Self
fn assert_none(self) -> Self
This checks the Option given and panics if it is not None. Otherwise it just returns the option back to you.
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.