pub struct Scheme { /* private fields */ }
Expand description
The main registry for fields and their associated types.
This is necessary to provide typechecking for runtime values provided to the execution context and also to aid parser in ambiguous contexts.
Implementations§
Source§impl<'s> Scheme
impl<'s> Scheme
Sourcepub fn with_capacity(n: usize) -> Self
pub fn with_capacity(n: usize) -> Self
Creates a new scheme with capacity for n
fields.
Sourcepub fn add_field(
&mut self,
name: String,
ty: Type,
) -> Result<(), FieldRedefinitionError>
pub fn add_field( &mut self, name: String, ty: Type, ) -> Result<(), FieldRedefinitionError>
Registers a field and its corresponding type.
Sourcepub fn try_from_iter(
iter: impl IntoIterator<Item = (String, Type)>,
) -> Result<Self, FieldRedefinitionError>
pub fn try_from_iter( iter: impl IntoIterator<Item = (String, Type)>, ) -> Result<Self, FieldRedefinitionError>
Registers a series of fields from an iterable, reporting any conflicts.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scheme
impl<'de> Deserialize<'de> for Scheme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Scheme
Auto Trait Implementations§
impl Freeze for Scheme
impl RefUnwindSafe for Scheme
impl Send for Scheme
impl Sync for Scheme
impl Unpin for Scheme
impl UnwindSafe for Scheme
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.