INNER CODE UNIT · Rust
push_bool
Tencent/TNN · third_party/flatbuffers/rust/flexbuffers/src/builder/mod.rs:211
fn push_bool(&mut self, x: bool) {
self.values.push(Value::Bool(x));
}
fn store_blob(&mut self, xs: &[u8]) -> Value {
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();
self.buffer.extend_from_slice(xs);
Value::Reference {
fxb_type: FlexBufferType::Blob,
address,
child_width: width,
}
}
fn push_str(&mut self, x: &str) {
let mut string = self.store_blob(x.as_bytes());