pub enum AbiType {
}Expand description
ABI value type.
Variants§
Uint(u16)
Unsigned integer of n bits.
Int(u16)
Signed integer of n bits.
VarUint(NonZeroU8)
Variable-length unsigned integer of maximum n bytes.
VarInt(NonZeroU8)
Variable-length signed integer of maximum n bytes.
Bool
Boolean.
Cell
Tree of cells (Cell).
Address
Internal address (IntAddr).
Bytes
Byte array.
FixedBytes(usize)
Byte array of fixed length.
String
Utf8-encoded string.
Token
Variable length 120-bit integer (Tokens).
Tuple(Arc<[NamedAbiType]>)
Product type.
Array(Arc<Self>)
Array of elements of the specified ABI type.
FixedArray(Arc<Self>, usize)
Fixed-length array of elements of the specified ABI type.
Map(PlainAbiType, Arc<Self>)
Dictionary with the specified key and value ABI types.
Optional(Arc<Self>)
Optional type.
Ref(Arc<Self>)
Type stored in a new cell.
Implementations§
Source§impl AbiType
impl AbiType
Sourcepub fn named<T: Into<String>>(self, name: T) -> NamedAbiType
pub fn named<T: Into<String>>(self, name: T) -> NamedAbiType
Returns a named ABI type.
Sourcepub fn as_plain(&self) -> Option<PlainAbiType>
pub fn as_plain(&self) -> Option<PlainAbiType>
Tries to convert a generic ABI type into a plain ABI type.
Sourcepub fn max_size(&self) -> CellTreeStats
pub fn max_size(&self) -> CellTreeStats
Returns the maximum number of bits and refs that this type can occupy.
Sourcepub fn flatten(self) -> AbiTypeFlatten ⓘ
pub fn flatten(self) -> AbiTypeFlatten ⓘ
Returns an iterator with the first-level tuple flattened.
Can be used to pass an ABI struct as arguments to the
FunctionBuilder::with_unnamed_inputs or FunctionBuilder::with_unnamed_outputs
Sourcepub fn unnamed_tuple<I>(values: I) -> Selfwhere
I: IntoIterator<Item = AbiType>,
pub fn unnamed_tuple<I>(values: I) -> Selfwhere
I: IntoIterator<Item = AbiType>,
Simple tuple type constructor.
Sourcepub fn fixedarray<T>(ty: T, len: usize) -> Self
pub fn fixedarray<T>(ty: T, len: usize) -> Self
Simple fixedarrayN type constructor.
Sourcepub fn map<V>(key_ty: PlainAbiType, value_ty: V) -> Self
pub fn map<V>(key_ty: PlainAbiType, value_ty: V) -> Self
Simple tuple type constructor.
Trait Implementations§
Source§impl AsRef<AbiType> for NamedAbiType
impl AsRef<AbiType> for NamedAbiType
Source§impl From<PlainAbiType> for AbiType
impl From<PlainAbiType> for AbiType
Source§fn from(value: PlainAbiType) -> Self
fn from(value: PlainAbiType) -> Self
Source§impl IgnoreName for AbiType
impl IgnoreName for AbiType
Source§type Unnamed<'a> = &'a WithoutName<AbiType>
type Unnamed<'a> = &'a WithoutName<AbiType>
Source§fn ignore_name(&self) -> Self::Unnamed<'_>
fn ignore_name(&self) -> Self::Unnamed<'_>
WithoutName.impl Eq for AbiType
impl StructuralPartialEq for AbiType
Auto Trait Implementations§
impl Freeze for AbiType
impl RefUnwindSafe for AbiType
impl Send for AbiType
impl Sync for AbiType
impl Unpin for AbiType
impl UnwindSafe for AbiType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self to key and returns true if they are equal.