Skip to main content

Shape

Struct Shape 

Source
pub struct Shape {
    pub name: &'static str,
    pub params: &'static [&'static str],
    pub layout: Layout,
    pub notes: Option<&'static Notes>,
}
Expand description

A declared message: its name, and what it is made of.

Fields§

§name: &'static str

The type’s name, which is its Flow type’s.

§params: &'static [&'static str]

Its type parameters’ names, in order.

§layout: Layout

Its fields or its constructors.

§notes: Option<&'static Notes>

What a declaration’s text says beside its shape, when it has one.

Implementations§

Source§

impl Shape

Source

pub fn ctors(&self) -> &'static [Ctor]

Its constructors; none for a record.

Source

pub fn constants(&self) -> Vec<(String, u64)>

Each constructor’s name as a constant spells it, the shape’s name and the constructor’s in capitals joined by _, and its number: TERM_JSON_VALUE for Term::JsonValue. A toolkit in another language takes its numbers from these.

Source

pub fn project(&'static self, catalog: &Catalog) -> Option<(Catalog, Type)>

catalog with this shape and every shape it reaches declared, and the type this shape is there, as project gives them.

§Panics

As project’s.

Trait Implementations§

Source§

impl Debug for Shape

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Shape

§

impl Freeze for Shape
where &'static str: Freeze, &'static [&'static str]: Freeze, &'static [Field]: Freeze, &'static [Ctor]: Freeze, &'static [fn() -> WireForm]: Freeze, &'static Notes: Freeze,

§

impl Move for Shape

§

impl RefUnwindSafe for Shape

§

impl Send for Shape
where &'static str: Send, &'static [&'static str]: Send, &'static [Field]: Send, &'static [Ctor]: Send, &'static [fn() -> WireForm]: Send, &'static Notes: Send,

§

impl Sync for Shape

§

impl Unpin for Shape
where &'static str: Unpin, &'static [&'static str]: Unpin, &'static [Field]: Unpin, &'static [Ctor]: Unpin, &'static [fn() -> WireForm]: Unpin, &'static Notes: Unpin,

§

impl UnsafeUnpin for Shape
where &'static str: UnsafeUnpin, &'static [&'static str]: UnsafeUnpin, &'static [Field]: UnsafeUnpin, &'static [Ctor]: UnsafeUnpin, &'static [fn() -> WireForm]: UnsafeUnpin, &'static Notes: UnsafeUnpin,

§

impl UnwindSafe for Shape
where &'static str: UnwindSafe, &'static [&'static str]: UnwindSafe, &'static [Field]: UnwindSafe, &'static [Ctor]: UnwindSafe, &'static [fn() -> WireForm]: UnwindSafe, &'static Notes: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.