MCPcopy Create free account
hub / github.com/apache/arrow-rs / try_set

Method try_set

arrow-json/src/reader/struct_array.rs:55–61  ·  view source on GitHub ↗
(&mut self, field_idx: usize, row_idx: usize, pos: u32)

Source from the content-addressed store, hash-verified

53 }
54
55 fn try_set(&mut self, field_idx: usize, row_idx: usize, pos: u32) -> Option<()> {
56 let idx = field_idx
57 .checked_mul(self.row_count)?
58 .checked_add(row_idx)?;
59 *self.data.get_mut(idx)? = pos;
60 Some(())
61 }
62
63 fn set(&mut self, field_idx: usize, row_idx: usize, pos: u32) {
64 self.data[field_idx * self.row_count + row_idx] = pos;

Callers 1

decodeMethod · 0.80

Calls 3

checked_addMethod · 0.45
checked_mulMethod · 0.45
get_mutMethod · 0.45

Tested by

no test coverage detected