pub struct Bindings(/* private fields */);Expand description
Term definitions of a context, keyed by term and kept in insertion order.
Implementations§
Source§impl Bindings
impl Bindings
Sourcepub fn insert(
&mut self,
key: Key,
def: Nullable<TermDefinition>,
) -> Option<Nullable<TermDefinition>>
pub fn insert( &mut self, key: Key, def: Nullable<TermDefinition>, ) -> Option<Nullable<TermDefinition>>
Binds key to def, returning the definition it replaced, if any.
Source§impl Bindings
impl Bindings
Sourcepub fn get(&self, key: &Key) -> Option<Nullable<&TermDefinition>>
pub fn get(&self, key: &Key) -> Option<Nullable<&TermDefinition>>
Returns the definition bound to the given term, if any.
The result is Some(Nullable::Null) for a term the context explicitly
unsets by binding it to null.
Sourcepub fn get_entry(&self, i: usize) -> Option<(&Key, Nullable<&TermDefinition>)>
pub fn get_entry(&self, i: usize) -> Option<(&Key, Nullable<&TermDefinition>)>
Returns the ith binding in insertion order, if there is one.
Sourcepub fn iter(&self) -> BindingsIter<'_> ⓘ
pub fn iter(&self) -> BindingsIter<'_> ⓘ
Returns an iterator over the bindings, in insertion order.
Sourcepub fn insert_with(
&mut self,
key: Key,
def: Nullable<TermDefinition>,
) -> Option<Nullable<TermDefinition>>
pub fn insert_with( &mut self, key: Key, def: Nullable<TermDefinition>, ) -> Option<Nullable<TermDefinition>>
Binds key to def, returning the definition it replaced, if any.
Same as insert.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Bindings
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Bindings
Available on crate feature
serde only.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 Bindings
Source§impl FromIterator<(Key, Nullable<TermDefinition>)> for Bindings
impl FromIterator<(Key, Nullable<TermDefinition>)> for Bindings
Source§fn from_iter<T: IntoIterator<Item = (Key, Nullable<TermDefinition>)>>(
iter: T,
) -> Self
fn from_iter<T: IntoIterator<Item = (Key, Nullable<TermDefinition>)>>( iter: T, ) -> Self
Creates a value from an iterator. Read more
Source§impl IntoIterator for Bindings
impl IntoIterator for Bindings
impl StructuralPartialEq for Bindings
Auto Trait Implementations§
impl Freeze for Bindings
impl RefUnwindSafe for Bindings
impl Send for Bindings
impl Sync for Bindings
impl Unpin for Bindings
impl UnsafeUnpin for Bindings
impl UnwindSafe for Bindings
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Checks if
self is equivalent to key.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.