pub enum Primitive {
Show 28 variants
Account,
Blob,
Bool,
Date,
Decimal,
Duration,
E8s,
E18s,
Float32,
Float64,
Int,
Int8,
Int16,
Int32,
Int64,
Int128,
Nat,
Nat8,
Nat16,
Nat32,
Nat64,
Nat128,
Principal,
Subaccount,
Text,
Timestamp,
Ulid,
Unit,
}Expand description
Primitive
Variants§
Account
Blob
Bool
Date
Decimal
Duration
E8s
E18s
Float32
Float64
Int
Int8
Int16
Int32
Int64
Int128
Nat
Nat8
Nat16
Nat32
Nat64
Nat128
Principal
Subaccount
Text
Timestamp
Ulid
Unit
Implementations§
Source§impl Primitive
impl Primitive
pub const fn supports_arithmetic(self) -> bool
pub const fn supports_copy(self) -> bool
pub const fn supports_display(self) -> bool
pub const fn supports_hash(self) -> bool
pub const fn supports_num_cast(self) -> bool
pub const fn supports_ord(self) -> bool
pub const fn is_decimal(self) -> bool
pub const fn is_numeric(self) -> bool
pub const fn is_float(self) -> bool
pub const fn is_signed_int(self) -> bool
pub const fn is_unsigned_int(self) -> bool
pub const fn is_int(self) -> bool
pub const fn is_fixed_point(self) -> bool
pub fn as_type(self) -> TokenStream
pub fn num_cast_fn(self) -> String
Trait Implementations§
Source§impl CandidType for Primitive
impl CandidType for Primitive
Source§impl<'de> Deserialize<'de> for Primitive
impl<'de> Deserialize<'de> for Primitive
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromMeta for Primitive
impl FromMeta for Primitive
Source§fn from_string(s: &str) -> Result<Self, Error>
fn from_string(s: &str) -> Result<Self, Error>
Create an instance from a string literal in a value position.
fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
Source§fn from_meta(item: &Meta) -> Result<Self, Error>
fn from_meta(item: &Meta) -> Result<Self, Error>
Create an instance from a
syn::Meta by dispatching to the format-appropriate
trait function. This generally should not be overridden by implementers. Read moreSource§fn from_none() -> Option<Self>
fn from_none() -> Option<Self>
When a field is omitted from a parent meta-item,
from_none is used to attempt
recovery before a missing field error is generated. Read moreSource§fn from_word() -> Result<Self, Error>
fn from_word() -> Result<Self, Error>
Create an instance from the presence of the word in the attribute with no
additional options specified.
Source§fn from_list(items: &[NestedMeta]) -> Result<Self, Error>
fn from_list(items: &[NestedMeta]) -> Result<Self, Error>
Create an instance from a list of nested meta items.
Source§fn from_value(value: &Lit) -> Result<Self, Error>
fn from_value(value: &Lit) -> Result<Self, Error>
Create an instance from a literal value of either
foo = "bar" or foo("bar").
This dispatches to the appropriate method based on the type of literal encountered,
and generally should not be overridden by implementers. Read morefn from_expr(expr: &Expr) -> Result<Self, Error>
Source§impl ToTokens for Primitive
impl ToTokens for Primitive
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Copy for Primitive
impl Eq for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.