#[repr(C)]pub struct CounterPayload {
pub key_descriptor: *const TypeDescriptor,
pub entries: HashMap<DynamicKey, GcRef>,
}Expand description
The Counter[T] payload (§6.2, §11.3). A map whose values are always Int
and whose absent keys read as zero. Backed by HashMap<DynamicKey, GcRef>
where each value is a boxed Int; the key descriptor selects hash/eq.
Fields§
§key_descriptor: *const TypeDescriptorThe descriptor for every key, or null when the construction site had no
static key type. A label, not the authority: each key’s DynamicKey
carries its own. Read it through CounterPayload::key.
entries: HashMap<DynamicKey, GcRef>The entries: key → boxed Int value.
Implementations§
Source§impl CounterPayload
impl CounterPayload
Sourcepub fn key(&self) -> Option<&'static TypeDescriptor>
pub fn key(&self) -> Option<&'static TypeDescriptor>
The key label, or None when this counter was never told its key type.
Auto Trait Implementations§
impl !RefUnwindSafe for CounterPayload
impl !Send for CounterPayload
impl !Sync for CounterPayload
impl !UnwindSafe for CounterPayload
impl Freeze for CounterPayload
impl Unpin for CounterPayload
impl UnsafeUnpin for CounterPayload
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