Skip to main content

FieldType

Enum FieldType 

Source
pub enum FieldType {
Show 26 variants List { item: &'static FieldType, max_items: u32, }, Named(TypeLink), Nat8, Nat16, Nat32, Int8, Int16, Int32, Nat64, Int64, Nat128, Int128, U256, Ulid, Date, Timestamp, Duration, Decimal { scale: u32, }, Float32, Float64, Bool, Principal, Subaccount, Account, Text { max_bytes: u32, }, Blob { max_bytes: u32, },
}
Expand description

Stored value semantics supported by this increment.

Variants§

§

List

An ordered bounded list of scalars or named values.

Fields

§item: &'static FieldType

Exact element type; optional elements and inline lists are not admitted yet.

§max_items: u32

Maximum number of elements, from zero through 256.

§

Named(TypeLink)

A compiler-resolved named value. Scalar newtypes and unit enums support secondary keys. Primary and reference keys require supported primitives.

§

Nat8

Exact unsigned 8-bit integer.

§

Nat16

Exact unsigned 16-bit integer.

§

Nat32

Exact unsigned 32-bit integer.

§

Int8

Exact signed 8-bit integer.

§

Int16

Exact signed 16-bit integer.

§

Int32

Exact signed 32-bit integer.

§

Nat64

Exact unsigned 64-bit integer.

§

Int64

Exact signed 64-bit integer, without unsigned or floating-point coercion.

§

Nat128

Exact unsigned 128-bit integer, without narrowing or floating-point coercion.

§

Int128

Exact signed 128-bit integer, without narrowing or floating-point coercion.

§

U256

Exact unsigned 256-bit integer, stored as 32 big-endian bytes.

§

Ulid

Exact 16-byte ULID, ordered by timestamp prefix then remaining bits.

§

Date

Gregorian epoch days, bounded to years 0000 through 9999.

§

Timestamp

Signed Unix milliseconds; full i64 domain.

§

Duration

Nonnegative milliseconds; full u64 domain.

§

Decimal

Exact decimal, stored at the declared fractional scale without rounding.

Fields

§scale: u32

Number of fractional places, 0 through 28.

§

Float32

Finite IEEE-754 single precision, canonical positive zero.

§

Float64

Finite IEEE-754 double precision, canonical positive zero.

§

Bool

Boolean, without numeric coercion.

§

Principal

Opaque IC identity, zero to 29 significant bytes; no authority policy.

§

Subaccount

Exact 32-byte opaque subaccount, ordered lexicographically.

§

Account

Platform account identity: owner then effective subaccount; absent and zero agree.

§

Text

Exact UTF-8 text, bounded in bytes without implicit normalization.

Fields

§max_bytes: u32

Maximum UTF-8 byte length (0..=4096); zero admits only empty text.

§

Blob

Exact binary bytes without UTF-8 interpretation or normalization.

Fields

§max_bytes: u32

Maximum payload length (0..=4096); zero admits only an empty value.

Trait Implementations§

Source§

impl Clone for FieldType

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 FieldType

Source§

impl Debug for FieldType

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for FieldType

Source§

impl PartialEq for FieldType

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FieldType

Auto Trait Implementations§

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.