aboutsummaryrefslogtreecommitdiff
path: root/common/object/src/buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/object/src/buffer.rs')
-rw-r--r--common/object/src/buffer.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/object/src/buffer.rs b/common/object/src/buffer.rs
index 1792d73..05557e4 100644
--- a/common/object/src/buffer.rs
+++ b/common/object/src/buffer.rs
@@ -19,6 +19,9 @@ impl ObjectBuffer {
pub fn as_object<'a>(&'a self) -> Object<'a> {
Object::load(&self.0).unwrap()
}
+ pub fn to_bytes(self) -> Vec<u8> {
+ self.0.into_iter().flat_map(u32::to_le_bytes).collect()
+ }
pub fn new(fields: &mut [(Tag, &dyn ValueStore)]) -> ObjectBuffer {
let mut tags = Vec::new();
let mut offsets = Vec::new();