Skip to main content

Setter

Trait Setter 

Source
pub trait Setter: Sized {
    type FieldTy;

    // Required methods
    fn with_durability(self, durability: Durability) -> Self;
    fn to(self, value: Self::FieldTy) -> Self::FieldTy;
}
Expand description

Setter for a field of an input.

Required Associated Types§

Required Methods§

Source

fn with_durability(self, durability: Durability) -> Self

Sets the durability that the field will have after this write.

Setting the durability to Durability::NEVER_CHANGE is allowed, but the field cannot be changed again afterward.

Source

fn to(self, value: Self::FieldTy) -> Self::FieldTy

Sets the field to value and returns its previous value.

§Panics

Panics if the field’s current durability is Durability::NEVER_CHANGE.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§