diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-25 13:25:41 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-25 13:25:41 +0100 |
| commit | 9c08495cca8b9aaf297c88da9ec98a619eb90762 (patch) | |
| tree | fedb0ba09e45c51f7f1b9d5ce9ea5b9a47ce6f01 /common/object | |
| parent | 6949f8d40d1784d5a9c54dbe44e212fe2fae76f4 (diff) | |
| download | jellything-9c08495cca8b9aaf297c88da9ec98a619eb90762.tar jellything-9c08495cca8b9aaf297c88da9ec98a619eb90762.tar.bz2 jellything-9c08495cca8b9aaf297c88da9ec98a619eb90762.tar.zst | |
user creation; flash message in request info
Diffstat (limited to 'common/object')
| -rw-r--r-- | common/object/src/buffer.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/object/src/buffer.rs b/common/object/src/buffer.rs index 703e203..1f8cec6 100644 --- a/common/object/src/buffer.rs +++ b/common/object/src/buffer.rs @@ -54,9 +54,14 @@ impl ObjectBuffer { } } +pub type OBB = ObjectBufferBuilder; + #[derive(Default)] pub struct ObjectBufferBuilder(Vec<(Tag, u32, Vec<u32>)>); impl ObjectBufferBuilder { + pub fn new() -> Self { + Self::default() + } pub fn push<T: ValueStore>(&mut self, tag: TypedTag<T>, value: T) { let ty = value.get_type(); let tyb = (ty as u32) << 2; @@ -71,6 +76,10 @@ impl ObjectBufferBuilder { self.0.push((tag.0, tyb | pad, vec_u8_to_u32(buf))); } } + pub fn with<T: ValueStore>(mut self, tag: TypedTag<T>, value: T) -> Self { + self.push(tag, value); + self + } pub fn finish(mut self) -> ObjectBuffer { let mut tags = Vec::new(); let mut offsets = Vec::new(); |