pub struct CustomFee<Fee> {
pub fee: Fee,
pub fee_collector_account_id: Option<AccountId>,
pub all_collectors_are_exempt: bool,
}
Expand description
A transfer fee to assess during a CryptoTransfer
that transfers units of the token to which the
fee is attached. A custom fee may be either fixed or fractional, and must specify a fee collector
account to receive the assessed fees. Only positive fees may be assessed.
Fields§
§fee: Fee
The fee to be charged
fee_collector_account_id: Option<AccountId>
The account to receive the custom fee.
all_collectors_are_exempt: bool
If true, fee fcollectors are not charged this fee for transfers.
Implementations§
source§impl CustomFee<Fee>
impl CustomFee<Fee>
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Create AnyCustomFee
from protobuf-encoded bytes
.
§Errors
Error::FromProtobuf
if decoding the bytes fails to produce a valid protobuf.Error::FromProtobuf
if decoding the protobuf fails.
Trait Implementations§
source§impl From<CustomFee<FixedFeeData>> for AnyCustomFee
impl From<CustomFee<FixedFeeData>> for AnyCustomFee
source§impl From<CustomFee<FractionalFeeData>> for AnyCustomFee
impl From<CustomFee<FractionalFeeData>> for AnyCustomFee
source§fn from(v: FractionalFee) -> Self
fn from(v: FractionalFee) -> Self
Converts to this type from the input type.
source§impl From<CustomFee<RoyaltyFeeData>> for AnyCustomFee
impl From<CustomFee<RoyaltyFeeData>> for AnyCustomFee
source§fn from(v: RoyaltyFee) -> Self
fn from(v: RoyaltyFee) -> Self
Converts to this type from the input type.
source§impl<Fee: PartialEq> PartialEq for CustomFee<Fee>
impl<Fee: PartialEq> PartialEq for CustomFee<Fee>
impl<Fee: Eq> Eq for CustomFee<Fee>
impl<Fee> StructuralPartialEq for CustomFee<Fee>
Auto Trait Implementations§
impl<Fee> Freeze for CustomFee<Fee>where
Fee: Freeze,
impl<Fee> RefUnwindSafe for CustomFee<Fee>where
Fee: RefUnwindSafe,
impl<Fee> Send for CustomFee<Fee>where
Fee: Send,
impl<Fee> Sync for CustomFee<Fee>where
Fee: Sync,
impl<Fee> Unpin for CustomFee<Fee>where
Fee: Unpin,
impl<Fee> UnwindSafe for CustomFee<Fee>where
Fee: 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
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
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request