pub trait SafeOption<T> {
// Required methods
fn safe_get(&self) -> Result<&T, ErrorInfo>;
fn safe_get_msg<S: Into<String>>(&self, msg: S) -> Result<&T, ErrorInfo>;
fn ok_msg(self, err: impl Into<String>) -> Result<T, ErrorInfo>;
}Required Methods§
fn safe_get(&self) -> Result<&T, ErrorInfo>
fn safe_get_msg<S: Into<String>>(&self, msg: S) -> Result<&T, ErrorInfo>
fn ok_msg(self, err: impl Into<String>) -> Result<T, ErrorInfo>
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.