Add some top-level examples (#303)

The examples show:
- Building a Signed Pod with different types of values
- Building a MainPod
- Input SignedPod to MainPod
- Input MainPod to MainPod
- Using MainPod or MockMainPod
- Using custom predicates
This commit is contained in:
Eduard S. 2025-06-19 19:31:54 +02:00 committed by GitHub
parent 6249406cb2
commit b7ac54d972
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 227 additions and 44 deletions

View file

@ -45,9 +45,9 @@ impl fmt::Display for OperationArg {
}
}
impl From<Value> for OperationArg {
fn from(v: Value) -> Self {
Self::Literal(v)
impl<V: Into<Value>> From<V> for OperationArg {
fn from(value: V) -> Self {
Self::Literal(value.into())
}
}
@ -57,24 +57,6 @@ impl From<&Value> for OperationArg {
}
}
impl From<&str> for OperationArg {
fn from(s: &str) -> Self {
Self::Literal(Value::from(s))
}
}
impl From<i64> for OperationArg {
fn from(v: i64) -> Self {
Self::Literal(Value::from(v))
}
}
impl From<bool> for OperationArg {
fn from(b: bool) -> Self {
Self::Literal(Value::from(b))
}
}
impl From<(&SignedPod, &str)> for OperationArg {
fn from((pod, key): (&SignedPod, &str)) -> Self {
// TODO: TryFrom.