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>
impl<'a, A> Record<'a, A>
Sourcepub fn field(self, words: Words<'_>, shape: A::Ty) -> Self
pub fn field(self, words: Words<'_>, shape: A::Ty) -> Self
States one member, under the name it is written with.
Sourcepub fn field_as<Carrier>(self, words: Words<'_>, shape: A::Ty) -> Self
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.
Sourcepub fn field_of<Carrier>(self, words: Words<'_>) -> Self
pub fn field_of<Carrier>(self, words: Words<'_>) -> Self
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.
Sourcepub fn into_shape(self) -> A::Ty
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>
impl<'a, A> RefUnwindSafe for Record<'a, A>
impl<'a, A> Send for Record<'a, A>
impl<'a, A> Sync for Record<'a, A>
impl<'a, A> Unpin for Record<'a, A>
impl<'a, A> UnsafeUnpin for Record<'a, A>
impl<'a, A> UnwindSafe for Record<'a, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<This> ShapeProgramExt<This> for This
impl<This> ShapeProgramExt<This> for This
Source§fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
Folds a declaration with this interpretation.