Skip to main content

Record

Struct Record 

Source
pub struct Record<'a, A>
where A: Sorts,
{ /* private fields */ }
Expand description

A product being stated, holding the algebra it is stated against.

Not part of this specification: it exists between what a backend reads and what it writes, so it needs no sort, no primitive, and no mention in the algebra. Members are built as they arrive, since a declaration has the algebra in hand from its first call.

Implementations§

Source§

impl<'a, A> Record<'a, A>
where A: ShapeAlg + FieldAlg,

Source

pub fn field(self, words: Words<'_>, shape: A::Ty) -> Self

States one member, under the name it is written with.

Source

pub fn field_as<Carrier>(self, words: Words<'_>, shape: A::Ty) -> Self

States one member, and the type a layout carries it in.

The type is the layout’s business and not this one’s: nothing here reads it, and an expansion emits a field of that type. A declaration writes field::<Carrier>(name, shape), which lowers to this.

Source

pub fn field_of<Carrier>(self, words: Words<'_>) -> Self
where Carrier: ShapeOf<A, Shape = A::Ty>,

States one member whose shape its own type states.

Available where a type says what it is — a layout with a shape of its own, or a leaf whose domain states one. A name that is only an alias states what the type it names states, so a member wanting a name of its own gives its shape instead.

Source

pub fn merge(self, shape: A::Ty) -> Self

States another product’s members as this one’s own.

Source

pub fn into_shape(self) -> A::Ty

Answers with the shape this product states.

Auto Trait Implementations§

§

impl<'a, A> Freeze for Record<'a, A>
where &'a A: Freeze, Vec<<A as Sorts>::Field>: Freeze,

§

impl<'a, A> RefUnwindSafe for Record<'a, A>

§

impl<'a, A> Send for Record<'a, A>
where &'a A: Send, Vec<<A as Sorts>::Field>: Send,

§

impl<'a, A> Sync for Record<'a, A>
where &'a A: Sync, Vec<<A as Sorts>::Field>: Sync,

§

impl<'a, A> Unpin for Record<'a, A>
where &'a A: Unpin, Vec<<A as Sorts>::Field>: Unpin,

§

impl<'a, A> UnsafeUnpin for Record<'a, A>

§

impl<'a, A> UnwindSafe for Record<'a, A>

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<This> ShapeProgramExt<This> for This

Source§

fn compile_shape<Program>( &self, program: Program, ) -> <Program as ShapeProgramAlg<This>>::Ty
where Program: ShapeProgramAlg<This>,

Folds a declaration with this interpretation.

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.