Skip to main content

WireForm

Enum WireForm 

Source
pub enum WireForm {
Show 22 variants Int, Decimal, Bool, Text, Bytes, Duration, Instant, Unit, Never, RunId, CallRef, Number, Rest, Option(fn() -> WireForm), List(fn() -> WireForm), Set(fn() -> WireForm), Dict(fn() -> WireForm, fn() -> WireForm), Tuple(&'static [fn() -> WireForm]), Declared(fn() -> &'static Shape), Param(usize), Applied(fn() -> &'static Shape, &'static [fn() -> WireForm]), Std { module: &'static str, name: &'static str, args: &'static [fn() -> WireForm], },
}
Expand description

How a field or payload part is written, as its Rust type says: the one mapping from a Rust type to a Flow type’s shape, which a message’s codec and a toolkit’s contract both read.

Variants§

§

Int

flow_value::Int: a signed number, a Flow Int.

§

Decimal

flow_value::Decimal: a Flow Decimal.

§

Bool

bool: one byte, 0 or 1.

§

Text

String: a text.

§

Bytes

flow_value::Bytes: a run of bytes.

§

Duration

flow_value::Duration: std’s duration.Duration.

§

Instant

flow_value::Instant: std’s time.Instant.

§

Unit

(): Unit, written as nothing.

§

Never

std::convert::Infallible: Never, which has no values.

§

RunId

RunId: a text that is a run’s id, which no Flow type checks.

§

CallRef

CallRef: a text that is a call’s id, which no Flow type checks.

§

Number

u64: a number, which no Flow type writes.

§

Rest

Rest: every byte left in the message, unframed.

§

Option(fn() -> WireForm)

Option<T>, of T’s form.

§

List(fn() -> WireForm)

Vec<T>, a list of T’s form.

§

Set(fn() -> WireForm)

A set of T’s form.

§

Dict(fn() -> WireForm, fn() -> WireForm)

A dictionary of these key and value forms.

§

Tuple(&'static [fn() -> WireForm])

A tuple of these forms, in order.

§

Declared(fn() -> &'static Shape)

A declared type with no type parameters.

§

Param(usize)

The declaration’s type parameter at this position.

§

Applied(fn() -> &'static Shape, &'static [fn() -> WireForm])

A declared type with type parameters, applied to these arguments.

§

Std

A std declaration, of this module and name, applied to these arguments: a prelude one, such as Result, has the empty module.

Fields

§module: &'static str

The std module that declares it; empty for the prelude.

§name: &'static str

Its name.

§args: &'static [fn() -> WireForm]

The forms of its type arguments.

Trait Implementations§

Source§

impl Clone for WireForm

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 Copy for WireForm

Source§

impl Debug for WireForm

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for WireForm

§

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

§

impl Move for WireForm

§

impl RefUnwindSafe for WireForm

§

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

§

impl Sync for WireForm

§

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

§

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

§

impl UnwindSafe for WireForm
where &'static [fn() -> WireForm]: UnwindSafe, &'static str: 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> 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> Same for T

Source§

type Output = T

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