ScopedSetState
No overview available.
Attributes
| Attribute | Type | Description |
|---|---|---|
| state | [SerializationState](serializationstate.md?sid=serializers_extra_serializationstate) | The state which has been set for the scope. |
| projector | callable | A function that projects from the state to the field that has been set. |
| value | T | The previous value of the field that has been set. |
Constructor
Signature
@staticmethod
def new(
state: &'scope mut SerializationState< 'py >,
projector: P,
new_value: T
) - > [ScopedSetState](../../validators/validation/state/scopedsetstate.md?sid=validators_validation_state_scopedsetstate)
Parameters
| Name | Type | Description |
|---|---|---|
| state | &'scope mut SerializationState< 'py > | The mutable reference to the serialization state being modified. |
| projector | P | A closure or function used to access and modify a specific field within the serialization state. |
| new_value | T | The temporary value to be applied to the projected field for the duration of the scope. |