Skip to main content

Form

Enum Form 

Source
pub enum Form<'t> {
Show 14 variants Scalar(Scalar), Text, Bytes, Host, List(&'t Type), Set(&'t Type), Dict(&'t Type, &'t Type), Tuple(&'t [Type]), Record(RecordForm<'t>), Enum(EnumForm<'t>), Newtype(Type, Option<StdForm>), Task(&'t Type), Never, NoEncoding,
}
Expand description

What a value of a type is made of.

Variants§

§

Scalar(Scalar)

A scalar.

§

Text

Text.

§

Bytes

Bytes.

§

Host

A host type, whose values are the host’s tokens.

§

List(&'t Type)

List<T>, of this element type.

§

Set(&'t Type)

Set<T>, of this element type.

§

Dict(&'t Type, &'t Type)

Dict<K, V>, of these key and value types.

§

Tuple(&'t [Type])

A tuple, of these part types in order.

§

Record(RecordForm<'t>)

A record.

§

Enum(EnumForm<'t>)

An enum, Option and json.Value included.

§

Newtype(Type, Option<StdForm>)

A newtype, written exactly as its base, this type with the newtype’s arguments in place (abi.md, Each type), and the form its values are held to when it is a std type that has one: a value out of that form is neither written nor read (abi.md, Decoding).

§

Task(&'t Type)

task.Task<T>, of this result type, which has no encoding outside a checkpoint’s arguments.

§

Never

Never, which has no values.

§

NoEncoding

A type with no encoding: a function, a nondata declaration, an unbound type parameter, or an incomplete type.

Implementations§

Source§

impl<'t> Form<'t>

Source

pub fn record(self) -> Option<RecordForm<'t>>

The record this is a value of, if it is a record.

Source

pub fn enumeration(self) -> Option<EnumForm<'t>>

The enum this is a value of, if it is an enum.

Source

pub fn list(self) -> Option<&'t Type>

The element type, if this is a list.

Trait Implementations§

Source§

impl<'t> Clone for Form<'t>

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<'t> Debug for Form<'t>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t> Forget for Form<'t>

§

impl<'t> Freeze for Form<'t>

§

impl<'t> Move for Form<'t>

§

impl<'t> RefUnwindSafe for Form<'t>

§

impl<'t> Send for Form<'t>
where &'t Type: Send, &'t [Type]: Send, &'t Arc<RecordShape>: Send, RawVecInner: Send, BoxRaw<Type>: Send, &'t Arc<EnumShape>: Send, &'t [Vec<Type>]: Send, &'t StdEnum<JsonValueCtor>: Send,

§

impl<'t> Sync for Form<'t>
where BoxRaw<Type>: Sync, RawVecInner: Sync, Arc<RecordShape>: Sync, Arc<EnumShape>: Sync, BoxRaw<[usize]>: Sync, BoxRaw<[Option<JsonValueCtor>]>: Sync,

§

impl<'t> Unpin for Form<'t>
where &'t Type: Unpin, &'t [Type]: Unpin, &'t Arc<RecordShape>: Unpin, *const u8 is !null: Unpin, Box<Type>: Unpin, &'t Arc<EnumShape>: Unpin, &'t [Vec<Type>]: Unpin, &'t StdEnum<JsonValueCtor>: Unpin,

§

impl<'t> UnsafeUnpin for Form<'t>

§

impl<'t> UnwindSafe for Form<'t>

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.