Skip to main content

Building

Struct Building 

Source
pub struct Building<'a, M> { /* private fields */ }
Expand description

The registry mid-fill: the model, plus the conversions supplied so far.

What a generator builds a conversion against. It sees every crossing it can compose from — RegistryBuilder::crossings hands them out inner-first, so by the time Option<Handle> is asked for, Handle is already in here.

It exposes exactly the reads a conversion needs, which is what keeps the half-filled state from leaking anywhere else: the resolved Registry is what the emitters get, and it is total.

Trait Implementations§

Source§

impl<M> Conversions<M> for Building<'_, M>

Source§

fn flat(&self) -> &Flat

The model.
Source§

fn reading(&self, key: &TypeKey) -> Option<TypeRef>

The reading for ty — what the frontend made of it. Read more
Source§

fn conversion(&self, dir: Direction, reading: &TypeRef) -> Option<&TypeEntry<M>>

The conversion for reading in dir, if there is one. Read more
Source§

fn callback_arg_plan(&self, key: &TypeKey) -> Option<&UnfoldPlan>

The decomposition of a callback argument type, if it has one. Read more
Source§

fn callback_arg_plans(&self) -> &HashMap<TypeKey, UnfoldPlan>

Every callback-argument decomposition, for the emitters that enumerate them rather than look one up.
Source§

fn unfold_plans(&self) -> &HashMap<Ident, UnfoldPlan>

The return decomposition of a function, if it has one.
Source§

fn error_plans(&self) -> &HashMap<Ident, UnfoldPlan>

The error-position decomposition of a fallible function.
Source§

fn decon_plans(&self) -> &HashMap<DeconId, DeconSpec>

The declaration-default decomposition behind each deconstructor.
Source§

fn crossing_keys(&self, dir: Direction) -> Vec<TypeKey>

Every type key that crosses in dir. Read more
Source§

fn reading_of(&self, ty: &Type) -> Option<TypeRef>

The reading for a spelling — identify, then look up. Read more
Source§

fn input_entry(&self, reading: &TypeRef) -> Option<&TypeEntry<M>>

Wire → rust.
Source§

fn output_entry(&self, reading: &TypeRef) -> Option<&TypeEntry<M>>

Rust → wire.
Source§

fn origin_module(&self, ident: &Ident) -> Option<Path>

The origin crate’s module path for an item, or None when unknown.
Source§

fn default_module(&self) -> Option<Path>

The default module for references with no recorded origin.

Auto Trait Implementations§

§

impl<'a, M> !Send for Building<'a, M>

§

impl<'a, M> !Sync for Building<'a, M>

§

impl<'a, M> Freeze for Building<'a, M>

§

impl<'a, M> RefUnwindSafe for Building<'a, M>
where M: RefUnwindSafe,

§

impl<'a, M> Unpin for Building<'a, M>

§

impl<'a, M> UnsafeUnpin for Building<'a, M>

§

impl<'a, M> UnwindSafe for Building<'a, M>
where M: 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.