pub trait StaticFieldHelpers<K = ()>: VirtualStaticField<K>where
K: DiscriminantTag,{
// Provided methods
fn get_all(&self) -> Option<Self::Many> { ... }
fn set_all(&mut self, v: Self::Many)
where Self::Many: Delimited { ... }
fn get(&self) -> Option<Self::Some> { ... }
fn set(&mut self, v: Self::Some)
where Self::Some: Delimited { ... }
}Expand description
Helper methods for accessing and mutating values in a VirtualStaticField.
These helpers operate on statically shaped fields with array-like semantics:
- collection size is fixed at compile time
- no resizing or extension is performed
- operations replace or read the entire structure
All operations are performed via tagged conversions.
§Default Discriminant
K = (): operates on a single default field, meaning one virtual static field is assumed.
Provided Methods§
Sourcefn get_all(&self) -> Option<Self::Many>
fn get_all(&self) -> Option<Self::Many>
Retrieves the full collection from the field interpreted as Many.
§Behavior
- Returns
Some(V)if the field is inManyform - Returns
Noneif the field isNoneorSome
Sourcefn set_all(&mut self, v: Self::Many)
fn set_all(&mut self, v: Self::Many)
Sets the field to a collection (Many).
§Behavior
- Replaces the entire field with the provided collection
- No resizing or partial updates are performed
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§
impl<T, K> StaticFieldHelpers<K> for Twhere
T: VirtualStaticField<K>,
K: DiscriminantTag,
Blanket impl for all VirtualStaticField types.
This trait is not intended to be implemented manually. It exists as an ergonomic replacement for free helper functions.
All methods have default implementations, making this forward-compatible: new helpers can be added without breaking existing code.