pub enum Schema {
Show 14 variants
Boolean {
constant: Option<bool>,
},
Integer(IntegerSchema),
String(StringSchema),
Bytes {
min_length: Option<usize>,
max_length: Option<usize>,
},
CidLink,
Blob {
accept: Vec<String>,
max_size: Option<u64>,
},
Array {
items: Option<Box<Schema>>,
min_length: Option<usize>,
max_length: Option<usize>,
},
Object(ObjectSchema),
Ref(String),
Union {
refs: Vec<String>,
closed: bool,
},
Unknown,
Null,
Token,
Unrecognised(String),
}Expand description
One schema node.
Variants§
Boolean
boolean, optionally pinned to one value.
Integer(IntegerSchema)
integer.
String(StringSchema)
string.
Bytes
bytes, whose length bounds are on the decoded byte count.
Fields
CidLink
cid-link: {"$link": "<cid>"}.
Blob
blob.
Fields
Array
array.
Fields
Object(ObjectSchema)
object.
Ref(String)
ref: a pointer at another definition, resolved at check time.
Union
union: one of several referenced definitions, chosen by $type.
Fields
Unknown
unknown: any object, but an object.
Null
null.
Token
token: as a field type, a placeholder that carries no data.
Unrecognised(String)
A type this build does not know, which accepts anything.
Trait Implementations§
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.