pub struct ActionRequest<T: MoveType> {
pub name: String,
pub amount: u64,
pub sender: Address,
pub recipient: Option<Address>,
pub spent_balance: Option<Balance<T>>,
pub approvals: VecSet<TypeName>,
/* private fields */
}
Expand description
A request to perform an “Action” on a token. Stores the information
about the action to be performed and must be consumed by the confirm_request
or confirm_request_mut
functions when the Rules are satisfied.
Fields§
§name: String
Name of the Action to look up in the Policy. Name can be one of the
default actions: transfer
, spend
, to_coin
, from_coin
or a
custom action.
amount: u64
Amount is present in all of the txs
sender: Address
Sender is a permanent field always
recipient: Option<Address>
Recipient is only available in transfer
action.
spent_balance: Option<Balance<T>>
The balance to be “spent” in the TokenPolicy
, only available
in the spend
action.
approvals: VecSet<TypeName>
Collected approvals (stamps) from completed Rules
. They’re matched
against TokenPolicy.rules
to determine if the request can be
confirmed.
Implementations§
Source§impl<T: MoveType> ActionRequest<T>
impl<T: MoveType> ActionRequest<T>
Source§impl<T: MoveType> ActionRequest<T>
impl<T: MoveType> ActionRequest<T>
pub fn move_instance(self, t: <T as MoveType>::TypeTag) -> MoveInstance<Self>
pub fn type_(t: <T as MoveType>::TypeTag) -> ActionRequestTypeTag<T>
Trait Implementations§
Source§impl<T: Clone + MoveType> Clone for ActionRequest<T>
impl<T: Clone + MoveType> Clone for ActionRequest<T>
Source§fn clone(&self) -> ActionRequest<T>
fn clone(&self) -> ActionRequest<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, T: MoveType> Deserialize<'de> for ActionRequest<T>
impl<'de, T: MoveType> Deserialize<'de> for ActionRequest<T>
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<T: MoveType> Display for ActionRequest<T>
impl<T: MoveType> Display for ActionRequest<T>
Source§impl<T: MoveType> MoveStruct for ActionRequest<T>
impl<T: MoveType> MoveStruct for ActionRequest<T>
type StructTag = ActionRequestTypeTag<T>
Source§impl<T: MoveType> MoveType for ActionRequest<T>
impl<T: MoveType> MoveType for ActionRequest<T>
Source§impl<T> Serialize for ActionRequest<T>
impl<T> Serialize for ActionRequest<T>
Source§impl<T: MoveType> StaticAddress for ActionRequest<T>
impl<T: MoveType> StaticAddress for ActionRequest<T>
Source§impl<T: MoveType> StaticModule for ActionRequest<T>
impl<T: MoveType> StaticModule for ActionRequest<T>
fn module() -> Identifier
Source§impl<T: MoveType> StaticName for ActionRequest<T>
impl<T: MoveType> StaticName for ActionRequest<T>
fn name() -> Identifier
Source§impl<T: MoveType + StaticTypeTag> StaticTypeParams for ActionRequest<T>
impl<T: MoveType + StaticTypeTag> StaticTypeParams for ActionRequest<T>
fn type_params() -> Vec<TypeTag>
Source§impl<T: MoveType> Tabled for ActionRequest<T>
impl<T: MoveType> Tabled for ActionRequest<T>
impl<T: Eq + MoveType> Eq for ActionRequest<T>
impl<T: MoveType> StructuralPartialEq for ActionRequest<T>
Auto Trait Implementations§
impl<T> Freeze for ActionRequest<T>
impl<T> RefUnwindSafe for ActionRequest<T>where
T: RefUnwindSafe,
impl<T> Send for ActionRequest<T>where
T: Send,
impl<T> Sync for ActionRequest<T>where
T: Sync,
impl<T> Unpin for ActionRequest<T>where
T: Unpin,
impl<T> UnwindSafe for ActionRequest<T>where
T: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more