Skip to main content

ScopedSetState

No overview available.

Attributes

AttributeTypeDescription
state[ValidationState](validationstate.md?sid=validators_validation_state_validationstate)The state which has been set for the scope.
projectorfunctionA function that projects from the state to the field that has been set.
valueTThe previous value of the field that has been set.

Constructor

Signature

@staticmethod
def new(
state: &'scope mut ValidationState,
projector: P,
new_value: T
) - > [ScopedSetState](scopedsetstate.md?sid=validators_validation_state_scopedsetstate)

Parameters

NameTypeDescription
state&'scope mut ValidationStateThe mutable reference to the validation state being modified.
projectorPA closure that maps the validation state to the specific field being scoped.
new_valueTThe temporary value to assign to the projected field for the duration of the scope.