Struct ibc_data_types::apps::transfer::Coin
source · pub struct Coin<D> {
pub denom: D,
pub amount: Amount,
}
Expand description
Coin defines a token with a denomination and an amount.
Fields§
§denom: D
Denomination
amount: Amount
Amount
Implementations§
source§impl<D> Coin<D>
impl<D> Coin<D>
pub fn from_string_list( coin_str: &str ) -> Result<Vec<Coin<D>>, TokenTransferError>
Trait Implementations§
source§impl<D> BorshDeserialize for Coin<D>where
D: BorshDeserialize,
Amount: BorshDeserialize,
impl<D> BorshDeserialize for Coin<D>where
D: BorshDeserialize,
Amount: BorshDeserialize,
fn deserialize_reader<R>(reader: &mut R) -> Result<Coin<D>, Error>where
R: Read,
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl<D> Decode for Coin<D>where
D: Decode,
impl<D> Decode for Coin<D>where
D: Decode,
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Coin<D>, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Coin<D>, Error>where
__CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
source§impl<'de, D> Deserialize<'de> for Coin<D>where
D: Deserialize<'de>,
impl<'de, D> Deserialize<'de> for Coin<D>where
D: Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Coin<D>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Coin<D>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<D> Encode for Coin<D>where
D: Encode,
impl<D> Encode for Coin<D>where
D: Encode,
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)where
__CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl<D> JsonSchema for Coin<D>where
D: JsonSchema,
impl<D> JsonSchema for Coin<D>where
D: JsonSchema,
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl<D> Ord for Coin<D>where
D: Ord,
impl<D> Ord for Coin<D>where
D: Ord,
source§impl<D> PartialEq for Coin<D>where
D: PartialEq,
impl<D> PartialEq for Coin<D>where
D: PartialEq,
source§impl<D> PartialOrd for Coin<D>where
D: PartialOrd,
impl<D> PartialOrd for Coin<D>where
D: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<D> Serialize for Coin<D>where
D: Serialize,
impl<D> Serialize for Coin<D>where
D: Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<D> EncodeLike for Coin<D>where
D: Encode,
impl<D> Eq for Coin<D>where
D: Eq,
impl<D> StructuralEq for Coin<D>
impl<D> StructuralPartialEq for Coin<D>
Auto Trait Implementations§
impl<D> RefUnwindSafe for Coin<D>where
D: RefUnwindSafe,
impl<D> Send for Coin<D>where
D: Send,
impl<D> Sync for Coin<D>where
D: Sync,
impl<D> Unpin for Coin<D>where
D: Unpin,
impl<D> UnwindSafe for Coin<D>where
D: UnwindSafe,
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
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more