INNER CODE UNIT · Rust
push_blob
Tencent/TNN · third_party/flatbuffers/rust/flexbuffers/src/builder/mod.rs:233
fn push_blob(&mut self, x: &[u8]) {
let blob = self.store_blob(x);
self.values.push(blob);
}
fn push_bools(&mut self, xs: &[bool]) {
let length = Value::UInt(xs.len() as u64);
let width = length.width_or_child_width();
align(&mut self.buffer, width);
store_value(&mut self.buffer, length, width);
let address = self.buffer.len();
for &b in xs.iter() {
self.buffer.push(b as u8);
self.buffer.resize(self.buffer.len() + width as usize, 0);
}
self.values.push(Value::Reference {
fxb_type: FlexBufferType::VectorBool,
address,
child_width: width,