pub struct Definitions<T, B, L, M> { /* private fields */ }
Expand description

Context term definitions.

Implementations§

source§

impl<T, B, L, M> Definitions<T, B, L, M>

source

pub fn into_parts( self ) -> (HashMap<Key, NormalTermDefinition<T, B, L, M>>, Option<TypeTermDefinition>)

source

pub fn len(&self) -> usize

Returns the number of defined terms.

source

pub fn is_empty(&self) -> bool

Checks if no terms are defined.

source

pub fn get<Q>(&self, term: &Q) -> Option<TermDefinitionRef<'_, T, B, L, M>>where Q: Hash + Eq + ?Sized, Key: Borrow<Q>, KeywordType: Borrow<Q>,

Returns a reference to the definition of the given term, if any.

source

pub fn get_normal<Q>( &self, term: &Q ) -> Option<&NormalTermDefinition<T, B, L, M>>where Q: Hash + Eq + ?Sized, Key: Borrow<Q>,

Returns a reference to the normal definition of the given term, if any.

source

pub fn get_type(&self) -> Option<&TypeTermDefinition>

Returns a reference to the @type definition, if any.

source

pub fn contains_term<Q>(&self, term: &Q) -> boolwhere Q: Hash + Eq + ?Sized, Key: Borrow<Q>, KeywordType: Borrow<Q>,

source

pub fn insert( &mut self, binding: Binding<T, B, L, M> ) -> Option<TermDefinition<T, B, L, M>>

Inserts the given binding.

source

pub fn insert_normal( &mut self, term: Key, definition: NormalTermDefinition<T, B, L, M> ) -> Option<NormalTermDefinition<T, B, L, M>>

Defines the given normal term.

source

pub fn insert_type( &mut self, definition: TypeTermDefinition ) -> Option<TypeTermDefinition>

Inserts the given @type definition.

source

pub fn set_normal( &mut self, term: Key, definition: Option<NormalTermDefinition<T, B, L, M>> ) -> Option<NormalTermDefinition<T, B, L, M>>

Sets the given term normal definition.

source

pub fn set_type( &mut self, definition: Option<TypeTermDefinition> ) -> Option<TypeTermDefinition>

Sets the given @type definition.

source

pub fn iter(&self) -> Iter<'_, T, B, L, M>

Returns an iterator over the term definitions.

Trait Implementations§

source§

impl<T: Clone, B: Clone, L: Clone, M: Clone> Clone for Definitions<T, B, L, M>

source§

fn clone(&self) -> Definitions<T, B, L, M>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, B, L, M> Default for Definitions<T, B, L, M>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, T, B, L, M> IntoIterator for &'a Definitions<T, B, L, M>

§

type Item = BindingRef<'a, T, B, L, M>

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T, B, L, M>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, B, L, M> IntoIterator for Definitions<T, B, L, M>

§

type Item = Binding<T, B, L, M>

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, B, L, M>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, B, L, M> RefUnwindSafe for Definitions<T, B, L, M>where B: RefUnwindSafe, L: RefUnwindSafe, M: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, B, L, M> Send for Definitions<T, B, L, M>where B: Send, L: Send, M: Send, T: Send,

§

impl<T, B, L, M> Sync for Definitions<T, B, L, M>where B: Sync, L: Sync, M: Sync, T: Sync,

§

impl<T, B, L, M> Unpin for Definitions<T, B, L, M>where B: Unpin, L: Unpin, M: Unpin, T: Unpin,

§

impl<T, B, L, M> UnwindSafe for Definitions<T, B, L, M>where B: UnwindSafe, L: UnwindSafe, M: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> At for T

source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowStripped for T

source§

fn stripped(&self) -> &Stripped<T>

source§

impl<T> BorrowUnordered for T

source§

fn unordered(&self) -> &Unordered<T>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, C> FromWithContext<T, C> for T

source§

fn from_with(value: T, _context: &C) -> T

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U, C> IntoWithContext<U, C> for Twhere U: FromWithContext<T, C>,

source§

fn into_with(self, context: &C) -> U

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToOwned for T

§

type Owned = T

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U, C> TryFromWithContext<U, C> for Twhere U: IntoWithContext<T, C>,

§

type Error = Infallible

source§

fn try_from_with( value: U, context: &C ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U, C> TryIntoWithContext<U, C> for Twhere U: TryFromWithContext<T, C>,

§

type Error = <U as TryFromWithContext<T, C>>::Error

source§

fn try_into_with( self, context: &C ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

source§

impl<T> WithContext for Twhere T: ?Sized,

source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

source§

fn into_with<C>(self, context: C) -> Contextual<T, C>