Trait BuilderSpecificState
pub trait BuilderSpecificState: Debug {
// Provided methods
fn finish(
&mut self,
_metadata_builder: &mut dyn MetadataBuilder,
_value_builder: &mut ValueBuilder,
) { ... }
fn rollback(&mut self) { ... }
}Expand description
A trait for managing state specific to different builder types.
Provided Methods§
fn finish(
&mut self,
_metadata_builder: &mut dyn MetadataBuilder,
_value_builder: &mut ValueBuilder,
)
fn finish( &mut self, _metadata_builder: &mut dyn MetadataBuilder, _value_builder: &mut ValueBuilder, )
Called by ParentState::finish to apply any pending builder-specific changes.
The provided implementation does nothing by default.
Parameters:
metadata_builder: The metadata builder that was usedvalue_builder: The value builder that was used
fn rollback(&mut self)
fn rollback(&mut self)
Called by ParentState::drop to revert any changes that were eagerly applied, if
ParentState::finish was never invoked.
The provided implementation does nothing by default.
The base ParentState will handle rolling back the value and metadata builders,
but builder-specific state may need to revert its own changes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
impl BuilderSpecificState for ()
Empty no-op implementation for top-level variant building