pub struct StationSet { /* private fields */ }Expand description
Small ordered in-process Station collection for simulations and embedders.
Implementations§
Source§impl StationSet
impl StationSet
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty collection with capacity for capacity Stations.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more Stations and lookup entries.
Sourcepub fn remove(&mut self, station_id: StationId) -> Option<Station>
pub fn remove(&mut self, station_id: StationId) -> Option<Station>
Removes and returns the first Station with station_id.
Remaining Stations retain their iteration order. Lookup storage remains allocated for reuse when the indexed path is active.
Sourcepub fn get_mut(&mut self, station_id: StationId) -> Option<&mut Station>
pub fn get_mut(&mut self, station_id: StationId) -> Option<&mut Station>
Gets a mutable station by id.
Sourcepub fn get_pair_mut(
&mut self,
left_id: StationId,
right_id: StationId,
) -> Option<(&mut Station, &mut Station)>
pub fn get_pair_mut( &mut self, left_id: StationId, right_id: StationId, ) -> Option<(&mut Station, &mut Station)>
Gets two distinct mutable stations by id.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Station>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Station>
Iterates mutably over stations.
Sourcepub fn station_ids_in_scope(&self, scope: BarrierScope) -> Vec<StationId>
pub fn station_ids_in_scope(&self, scope: BarrierScope) -> Vec<StationId>
Returns station ids matching a barrier scope.
Sourcepub fn station_capacity(&self) -> usize
pub fn station_capacity(&self) -> usize
Station slots retained without growing the ordered collection.
Sourcepub fn lookup_capacity(&self) -> usize
pub fn lookup_capacity(&self) -> usize
Lookup entries retained without rehashing the Station index.
Sourcepub fn lookup_index_active(&self) -> bool
pub fn lookup_index_active(&self) -> bool
Returns whether Station lookup currently uses the indexed path.
Trait Implementations§
Source§impl Clone for StationSet
impl Clone for StationSet
Source§fn clone(&self) -> StationSet
fn clone(&self) -> StationSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StationSet
impl Debug for StationSet
Source§impl Default for StationSet
impl Default for StationSet
Source§fn default() -> StationSet
fn default() -> StationSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StationSet
impl RefUnwindSafe for StationSet
impl Send for StationSet
impl Sync for StationSet
impl Unpin for StationSet
impl UnsafeUnpin for StationSet
impl UnwindSafe for StationSet
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