Assorted tweaks to support external playground crate (#322)

* Assorted tweaks to support external playground crate

* Fix schemas

* Fixed schema again

* Add ToHex for RawValue

* Add FromHex to RawValue
This commit is contained in:
Rob Knight 2025-07-02 18:27:54 +02:00 committed by GitHub
parent 335100d1d7
commit 24cafde231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 111 additions and 46 deletions

View file

@ -50,7 +50,7 @@ impl ToFields for NativePredicate {
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
#[serde(tag = "type", content = "value")]
pub enum Predicate {
Native(NativePredicate),
@ -129,7 +129,7 @@ impl fmt::Display for Predicate {
}
/// Type encapsulating statements with their associated arguments.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
#[serde(tag = "predicate", content = "args")]
pub enum Statement {
None,
@ -368,7 +368,8 @@ impl ToFields for StatementArg {
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
#[serde(tag = "type", content = "value")]
pub enum ValueRef {
Literal(Value),
Key(AnchoredKey),