pub trait FrameMap {
type ExistingEntry<'a>: FrameMapOccupiedEntry
where Self: 'a;
type VacantEntry<'a>: FrameMapVacantEntry
where Self: 'a;
// Required methods
fn with_capacity(capacity: usize) -> Self;
fn entry(
&mut self,
frame_id: FrameId,
) -> FrameMapEntry<Self::ExistingEntry<'_>, Self::VacantEntry<'_>>;
fn len(&self) -> usize;
fn retain(&mut self, f: impl FnMut(&FrameId, &mut FrameBuilder) -> bool);
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
An abstraction of a Hash Map, suitable for reassembling frames.
Required Associated Types§
type ExistingEntry<'a>: FrameMapOccupiedEntry where Self: 'a
type VacantEntry<'a>: FrameMapVacantEntry where Self: 'a
Required Methods§
Sourcefn with_capacity(capacity: usize) -> Self
fn with_capacity(capacity: usize) -> Self
Creates a new map with the given capacity.
Sourcefn entry(
&mut self,
frame_id: FrameId,
) -> FrameMapEntry<Self::ExistingEntry<'_>, Self::VacantEntry<'_>>
fn entry( &mut self, frame_id: FrameId, ) -> FrameMapEntry<Self::ExistingEntry<'_>, Self::VacantEntry<'_>>
Returns the FrameMapEntry API for a vacant or existing entry.
Provided Methods§
Sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Indicates whether the map is empty.
Defaults to check if the FrameMap::len is 0.
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§
Source§impl FrameMap for FrameDashMap
impl FrameMap for FrameDashMap
type ExistingEntry<'a> = OccupiedEntry<'a, u32, FrameBuilder>
type VacantEntry<'a> = VacantEntry<'a, u32, FrameBuilder>
Source§impl FrameMap for FrameHashMap
Available on crate feature hashbrown only.
impl FrameMap for FrameHashMap
Available on crate feature
hashbrown only.