MCPcopy Create free account
hub / github.com/Pometry/Raphtory / push_value

Method push_value

raphtory-core/src/storage/string_col.rs:332–355  ·  view source on GitHub ↗
(&mut self, new_value: &str)

Source from the content-addressed store, hash-verified

330 }
331
332 pub fn push_value(&mut self, new_value: &str) -> Result<(), ArrowError> {
333 match self {
334 StringCol::Empty { len } => {
335 let index = *len;
336 let len = index + 1;
337 let value = new_value.to_owned();
338 *self = StringCol::One { len, index, value }
339 }
340 StringCol::One { index, value, len } => {
341 let mut values = StringColBuilder::with_capacity(*len + 1);
342 for _ in 0..*index {
343 values.append_null();
344 }
345 values.try_append_value(value)?;
346 for _ in *index + 1..*len {
347 values.append_null();
348 }
349 values.try_append_value(new_value)?;
350 *self = StringCol::Many { values };
351 }
352 StringCol::Many { values } => values.try_append_value(new_value)?,
353 }
354 Ok(())
355 }
356
357 pub fn push_null(&mut self) {
358 match self {

Callers 1

pushMethod · 0.80

Calls 3

to_ownedMethod · 0.80
append_nullMethod · 0.80
try_append_valueMethod · 0.80

Tested by

no test coverage detected