Skip to main content

SetOptional

Trait SetOptional 

Source
pub trait SetOptional<Tag> {
    type Value;

    // Required methods
    fn set(self, _tag: PhantomData<Tag>, value: Self::Value) -> Self;
    fn set_optional(
        self,
        _tag: PhantomData<Tag>,
        value: Self::Value,
    ) -> (Option<Self::Value>, Self);
}

Required Associated Types§

Required Methods§

Source

fn set(self, _tag: PhantomData<Tag>, value: Self::Value) -> Self

Source

fn set_optional( self, _tag: PhantomData<Tag>, value: Self::Value, ) -> (Option<Self::Value>, Self)

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§

Source§

impl<Context, Tag> SetOptional<Tag> for Context
where Context: UpdateField<Tag, IsOptional, Mapper = IsOptional, Output = Context>,

Source§

type Value = <Context as UpdateField<Tag, IsOptional>>::Value