MCPcopy Create free account
hub / github.com/hashintel/hash / index

Method index

libs/@local/hashql/core/src/intern/map.rs:704–708  ·  view source on GitHub ↗

Returns the interned value for the given ID. This method is similar to `get`, but panics if no value with the given ID exists. It's a more convenient alternative when you know the ID exists. # Panics Panics if no item with the given ID exists in the map. # Examples ``` # use hashql_core::{heap::Heap, intern::{InternMap, Decompose, Interned}, id::{HasId, Id, newtype}}; # newtype!(struct ValueI

(&self, id: T::Id)

Source from the content-addressed store, hash-verified

702 /// // let non_existent = map.index(ValueId::from_u32(999));
703 /// ```
704 pub fn index(&self, id: T::Id) -> T {
705 let partial = self.index_partial(id);
706
707 T::from_parts(id, partial)
708 }
709
710 /// Retrieves the partial representation of an interned value by its ID.
711 ///

Callers 3

BlockViewClass · 0.45
lookup_by_idFunction · 0.45
recursive_structuresFunction · 0.45

Calls 1

index_partialMethod · 0.80

Tested by 2

lookup_by_idFunction · 0.36
recursive_structuresFunction · 0.36