Skip to main content

IdModel

Struct IdModel 

Source
pub struct IdModel {
    pub vis: Visibility,
    pub subject: Ident,
    pub krate: Path,
    pub inner: Type,
}
Expand description

A declared ID WRAPPER, as the device reads it.

PLAIN, for Kits’ reason — public fields, no constructor, no validation. What is checked is checked at the FRONT END, where the tokens an author wrote are still in hand and a refusal can point at one.

Fields§

§vis: Visibility

The declaration’s own visibility, which the minted reading and the casts take: a door minted for a type nobody outside the module can name has no business being wider than the type.

§subject: Ident

The wrapper the faces are OF.

§krate: Path

The ingraph root the expansion spells its shelf through.

§inner: Type

The ONE type this wrapper holds, at position zero.

Implementations§

Source§

impl IdModel

Source

pub fn reading_name(&self) -> Ident

The reading this device mints for the filter face — <Name>Wire, the shape both live registers wrote by hand.

Source

pub fn emit(&self) -> TokenStream

The whole device, emitted.

TWO scopes, and the split is the one every emitter here draws: a name the declaring scope has to be able to WRITE goes outside — the minted reading is named by an associated type a downstream crate resolves — and everything else goes inside an anonymous const, which is where an emission puts what it owes the declaring scope no name for.

The INHERENT face is outside too, and for the stronger version of the same reason: an inherent impl inside a const _ block is invisible to every caller, which would make the casts a door nobody can open.

Auto Trait Implementations§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.