Once

Trait Once 

Source
pub trait Once: Kind0L1T {
    type Output<A>;

    // Required methods
    fn new<A>() -> ApplyOnce<Self, A>;
    fn get<A>(a: &ApplyOnce<Self, A>) -> Option<&A>;
    fn get_mut<A>(a: &mut ApplyOnce<Self, A>) -> Option<&mut A>;
    fn set<A>(a: &ApplyOnce<Self, A>, value: A) -> Result<(), A>;
    fn get_or_init<A, B: FnOnce() -> A>(a: &ApplyOnce<Self, A>, f: B) -> &A;
    fn into_inner<A>(a: ApplyOnce<Self, A>) -> Option<A>;
    fn take<A>(a: &mut ApplyOnce<Self, A>) -> Option<A>;
}
๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead

Required Associated Typesยง

Source

type Output<A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead

Required Methodsยง

Source

fn new<A>() -> ApplyOnce<Self, A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead
Source

fn get<A>(a: &ApplyOnce<Self, A>) -> Option<&A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead
Source

fn get_mut<A>(a: &mut ApplyOnce<Self, A>) -> Option<&mut A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead
Source

fn set<A>(a: &ApplyOnce<Self, A>, value: A) -> Result<(), A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead
Source

fn get_or_init<A, B: FnOnce() -> A>(a: &ApplyOnce<Self, A>, f: B) -> &A

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead
Source

fn into_inner<A>(a: ApplyOnce<Self, A>) -> Option<A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead
Source

fn take<A>(a: &mut ApplyOnce<Self, A>) -> Option<A>

๐Ÿ‘ŽDeprecated since 0.0.21: Use fp_library::v2::classes instead

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.

Implementorsยง