aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-10 01:11:36 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-10 01:11:36 +0100
commitf035474090d3c82f50c3860cbafd6f60b8af36e8 (patch)
treead05b9df5770bee3c1f020870911f7744977422d /common
parent7754a042ed80c7d8e2391925a8a6ae87a7610c8e (diff)
downloadjellything-f035474090d3c82f50c3860cbafd6f60b8af36e8.tar
jellything-f035474090d3c82f50c3860cbafd6f60b8af36e8.tar.bz2
jellything-f035474090d3c82f50c3860cbafd6f60b8af36e8.tar.zst
fix index key ser; query debug print
Diffstat (limited to 'common')
-rw-r--r--common/object/src/inspect.rs6
-rw-r--r--common/object/src/registry.rs4
2 files changed, 8 insertions, 2 deletions
diff --git a/common/object/src/inspect.rs b/common/object/src/inspect.rs
index 21648bd..bc217f0 100644
--- a/common/object/src/inspect.rs
+++ b/common/object/src/inspect.rs
@@ -24,10 +24,14 @@ impl Debug for Inspector<'_, Object<'_>> {
};
match ty {
x if x == STR => s.field(info.name, &self.1.get_typed::<&str>(i).unwrap()),
+ x if x == BINARY => s.field(info.name, &self.1.get_typed::<&[u8]>(i).unwrap()),
x if x == OBJECT => s.field(info.name, &self.1.get_typed::<Object>(i).unwrap()),
x if x == U32 => s.field(info.name, &self.1.get_typed::<u32>(i).unwrap()),
x if x == U64 => s.field(info.name, &self.1.get_typed::<u64>(i).unwrap()),
- _ => &mut s,
+ _ => {
+ nonexhaustive = true;
+ &mut s
+ }
};
}
if nonexhaustive {
diff --git a/common/object/src/registry.rs b/common/object/src/registry.rs
index d9da2fb..85d3ff2 100644
--- a/common/object/src/registry.rs
+++ b/common/object/src/registry.rs
@@ -13,11 +13,12 @@ pub mod types {
pub const OBJECT: TypeId = TypeId::of::<Object>();
pub const STR: TypeId = TypeId::of::<&str>();
+ pub const BINARY: TypeId = TypeId::of::<&[u8]>();
pub const U32: TypeId = TypeId::of::<u32>();
pub const U64: TypeId = TypeId::of::<u64>();
}
-#[derive(Default)]
+#[derive(Default, Clone)]
pub struct Registry {
tags: BTreeMap<Tag, TagInfo>,
}
@@ -42,6 +43,7 @@ impl Registry {
}
}
+#[derive(Clone)]
pub struct TagInfo {
pub name: &'static str,
pub r#type: Option<TypeId>,