Skip to main content

Row

Struct Row 

Source
pub struct Row { /* private fields */ }
Expand description

ONE ROW of an emitted package: a Rust member, the wire name it renders under, and the type it holds.

The struct field is Option<ty> in every case — see the module note’s reading of the de-Option law — so the row carries the INTERIOR and the emission adds the wrapper.

PUBLIC because Packages is: the root grain builds its own rows and mints them through the same emitter, and a row it could not name is an emitter it could not reach.

Implementations§

Source§

impl Row

Source

pub fn new(member: &Ident, ty: TokenStream, noun: &str) -> Self

One row: the Rust member, the type it holds, and the noun its doc sentence uses.

Source

pub fn rust_side(self) -> Self

The same row, RUST-SIDE — present on the struct, absent from its wire face.

§One row and not a whole package, which is what the measurement changed

The question tree carried no face at all while coordinates was the reason: an Embedding<E, N, S> has no async_graphql::InputType and cannot generically — its element type, width and space are all the declaration’s — so emitting one was E0277 at the declaration. But the tree’s OTHER rows cross fine: a question is a String, and a child route is another question package. Refusing the whole tree for one row’s sake published nothing where the text half was always publishable.

So the grain moves to the ROW. A package whose rows all cross is unchanged; a package holding this one publishes the rest, and a request that reaches it leaves the row None — which is what it means over the wire anyway, coordinates being the thing a client does not have.

to_value omits it for the same reason, so the crossing is lossy in exactly one direction and says so: a package built in Rust with coordinates and rendered to a Value renders its text. The raw-coordinate wire form that would close the gap needs an element-typed list crossing into Embedding, which nothing has yet.

Trait Implementations§

Source§

impl Debug for Row

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Send for Row

§

impl !Sync for Row

§

impl Freeze for Row

§

impl RefUnwindSafe for Row

§

impl Unpin for Row

§

impl UnsafeUnpin for Row

§

impl UnwindSafe for Row

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.