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

Method remove

libs/@local/hashql/core/src/id/slice.rs:314–316  ·  view source on GitHub ↗

Removes and returns the value at the given ID index. Returns `None` if the index is out of bounds or if the value was already `None`. The vector is not shrunk after removal. # Examples ``` # use hashql_core::id::{IdVec, Id as _, newtype}; # newtype!(struct MyId(u32 is 0..=0xFFFF_FF00)); let mut vec = IdVec:: >::new(); vec.insert(MyId::from_usize(0), "hello".to_string()); let

(&mut self, index: I)

Source from the content-addressed store, hash-verified

312 /// assert!(vec[MyId::from_usize(0)].is_none());
313 /// ```
314 pub fn remove(&mut self, index: I) -> Option<T> {
315 self.get_mut(index)?.take()
316 }
317
318 /// Returns `true` if the vector contains a value (not `None`) at the given ID index.
319 ///

Callers 15

getWebsiteContentFunction · 0.45
updateMethod · 0.45
destroyMethod · 0.45
destroyFunction · 0.45
destroyFunction · 0.45
destroyMethod · 0.45
destroyFunction · 0.45
validationHandlerFunction · 0.45
test_root_sortingFunction · 0.45
executeMethod · 0.45
load_chipFunction · 0.45

Calls 2

takeMethod · 0.45
get_mutMethod · 0.45

Tested by 2

test_root_sortingFunction · 0.36