Struct Env

Source
pub struct Env<'sg, LABEL: 'sg, DATA>(/* private fields */);
Expand description

Representation of an environment (i.e., a collection of resolved paths).

Implementations§

Source§

impl<'sg, LABEL, DATA> Env<'sg, LABEL, DATA>

Source

pub fn new() -> Self

Creates an empty environemnt.

Source

pub fn iter<'a>( &'a self, ) -> impl Iterator<Item = &'a ResolvedPath<'sg, LABEL, DATA>> + 'a

Create an iterator over all paths in the environment.

Source

pub fn is_empty(&self) -> bool

Returns true is the environment is empty, false otherwise.

Source§

impl<'sg, LABEL, DATA> Env<'sg, LABEL, DATA>
where ResolvedPath<'sg, LABEL, DATA>: Eq + Hash + Clone,

Source

pub fn single(path: ResolvedPath<'sg, LABEL, DATA>) -> Self

Create an environment with a single path.

Source

pub fn insert(&mut self, path: ResolvedPath<'sg, LABEL, DATA>)

Insert a path in the environment.

Source

pub fn merge(&mut self, other: &Self)

Add all paths in other to the current environment.

Trait Implementations§

Source§

impl<'sg, LABEL: 'sg + Clone, DATA> Clone for Env<'sg, LABEL, DATA>

Source§

fn clone(&self) -> Self

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<'sg, LABEL: Debug + 'sg, DATA: Debug> Debug for Env<'sg, LABEL, DATA>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<LABEL, DATA> Default for Env<'_, LABEL, DATA>

Source§

fn default() -> Self

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

impl<'sg: 'rslv, 'rslv, LABEL, DATA> EnvContainer<'sg, 'rslv, LABEL, DATA> for Env<'sg, LABEL, DATA>
where ResolvedPath<'sg, LABEL, DATA>: Hash + Eq,

Source§

fn empty() -> Self

Creates a new, container with an empty environment.
Source§

fn flat_map( &self, map: impl 'rslv + for<'short> FnOnce(&'short Env<'sg, LABEL, DATA>) -> Self, ) -> Self

Maps the current container to a new one, based a provided mapping of the underlying environment.
Source§

impl<'sg: 'rslv, 'rslv, LABEL, DATA> From<Env<'sg, LABEL, DATA>> for FutureWrapper<'rslv, Env<'sg, LABEL, DATA>>
where LABEL: Clone,

Source§

fn from(value: Env<'sg, LABEL, DATA>) -> Self

Converts to this type from the input type.
Source§

impl<'sg, LABEL: 'sg, DATA: 'sg, E> From<Env<'sg, LABEL, DATA>> for Result<Env<'sg, LABEL, DATA>, E>

Source§

fn from(value: Env<'sg, LABEL, DATA>) -> Self

Converts to this type from the input type.
Source§

impl<'sg, LABEL: 'sg, DATA: Hash> FromIterator<Env<'sg, LABEL, DATA>> for Env<'sg, LABEL, DATA>
where ResolvedPath<'sg, LABEL, DATA>: Eq + Hash,

Source§

fn from_iter<T: IntoIterator<Item = Env<'sg, LABEL, DATA>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'sg, LABEL: 'sg, DATA: Hash> FromIterator<ResolvedPath<'sg, LABEL, DATA>> for Env<'sg, LABEL, DATA>
where ResolvedPath<'sg, LABEL, DATA>: Eq + Hash,

Source§

fn from_iter<T: IntoIterator<Item = ResolvedPath<'sg, LABEL, DATA>>>( iter: T, ) -> Self

Creates a value from an iterator. Read more
Source§

impl<'sg, LABEL, DATA> IntoIterator for Env<'sg, LABEL, DATA>

Source§

type Item = ResolvedPath<'sg, LABEL, DATA>

The type of the elements being iterated over.
Source§

type IntoIter = <HashSet<ResolvedPath<'sg, LABEL, DATA>> as IntoIterator>::IntoIter

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<'sg, LABEL, DATA> Freeze for Env<'sg, LABEL, DATA>

§

impl<'sg, LABEL, DATA> RefUnwindSafe for Env<'sg, LABEL, DATA>
where DATA: RefUnwindSafe, LABEL: RefUnwindSafe,

§

impl<'sg, LABEL, DATA> !Send for Env<'sg, LABEL, DATA>

§

impl<'sg, LABEL, DATA> !Sync for Env<'sg, LABEL, DATA>

§

impl<'sg, LABEL, DATA> Unpin for Env<'sg, LABEL, DATA>

§

impl<'sg, LABEL, DATA> UnwindSafe for Env<'sg, LABEL, DATA>
where DATA: RefUnwindSafe, LABEL: RefUnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.