Skip to main content

Derived

Struct Derived 

Source
pub struct Derived {
    pub name: Ident,
    pub source: Path,
    pub field: Option<LitStr>,
}
Expand description

One REVERSE position: a record that points at this one, under the name this record calls it by.

There is no Rust field for one, ever — no storage, no field, no lie. The declaration names a SOURCE and the framework already knows how the two meet, because the source’s own declaration said so; what this adds is the name the position is reached under and, where the source points back through several fields, which of them this position means.

Fields§

§name: Ident

The position’s name — the word the declaration wrote, which is also the name a wire face will expose it under.

Held to the same namespace as the record’s fields: an entry colliding with a real field is refused by the front end, because one face has one namespace.

§source: Path

The record whose ref points back, exactly as the declaration spelled it.

A PATH rather than a resolved type, because a macro has tokens: every consequence of it is type-level — the audit names it in a bound — so an alias in the path is transparent and nothing here has to know what it resolves to.

§field: Option<LitStr>

field = "…" — WHICH of the source’s referring fields this position means, or None for the shorthand.

A string, because a field name is not a type on stable Rust: the audit it produces is a constant evaluation over the source’s emitted COLUMNS rather than a bound. The literal is kept whole so a refusal about the name lands on the name.

Trait Implementations§

Source§

impl Clone for Derived

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Derived

Source§

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

Formats the value using the given formatter. Read more

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> 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 = !

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.