pub struct ExternalizedAnchorVariableSupply<E, A>{ /* private fields */ }Expand description
Hash-based implementation of anchor variable supply.
Uses a HashMap internally for O(1) average-case lookups.
Thread-safe via RwLock.
Implementations§
Source§impl<E, A> ExternalizedAnchorVariableSupply<E, A>
impl<E, A> ExternalizedAnchorVariableSupply<E, A>
Sourcepub fn new(variable_name: impl Into<String>) -> Self
pub fn new(variable_name: impl Into<String>) -> Self
Creates a new externalized anchor variable supply.
Sourcepub fn variable_name(&self) -> &str
pub fn variable_name(&self) -> &str
Returns the variable name this supply tracks.
Sourcepub fn cascade_anchor<I>(&self, entities: I, new_anchor: A)where
I: IntoIterator<Item = E>,
pub fn cascade_anchor<I>(&self, entities: I, new_anchor: A)where
I: IntoIterator<Item = E>,
Updates anchors for all entities in a chain segment.
When an entity changes its chain position, all downstream entities in the chain need their anchor updated. This method cascades the update.
§Arguments
entities- Iterator of entities to update (in chain order)new_anchor- The new anchor for all entities
Trait Implementations§
Source§impl<E, A> AnchorVariableSupply<E, A> for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> AnchorVariableSupply<E, A> for ExternalizedAnchorVariableSupply<E, A>
Source§fn set_anchor(&self, entity: E, anchor: A)
fn set_anchor(&self, entity: E, anchor: A)
Sets the anchor for an entity. Read more
Source§impl<E, A> Debug for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> Debug for ExternalizedAnchorVariableSupply<E, A>
Auto Trait Implementations§
impl<E, A> !Freeze for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> RefUnwindSafe for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> Send for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> Sync for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> Unpin for ExternalizedAnchorVariableSupply<E, A>
impl<E, A> UnwindSafe for ExternalizedAnchorVariableSupply<E, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more