pub trait Pointed: Kind_cdc7cd43dac7585f {
// Required method
fn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>;
}Expand description
A type class for types that can be constructed from a single value.
Pointed represents a context that can be initialized with a value.
Required Methods§
Sourcefn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
fn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
The value wrapped in the context.
This method wraps a value in a context.
§Type Signature
forall a. Pointed f => a -> f a
§Type Parameters
A: The type of the value to wrap.
§Parameters
a: The value to wrap.
§Returns
A new context containing the value.
§Examples
use fp_library::classes::pointed::Pointed;
use fp_library::brands::OptionBrand;
let x = OptionBrand::pure(5);
assert_eq!(x, Some(5));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.