pub enum SubscriberInstruction {
Subscribe {
nonce: Nonce,
handler: Subscription,
},
Unsubscribe {
nonce: Nonce,
},
Update {
nonce: Nonce,
handler: Subscription,
},
Destroy {
nonce: Nonce,
},
}Expand description
Subscriber program instructions
Variants§
Subscribe
Subscribe to events
Fields
§
handler: SubscriptionSubscription data
Unsubscribe
Delete subscription
Update
Update subscription
Fields
§
nonce: NonceNonce used during subscription to differentiate handlers for the same topic/signer pair
§
handler: SubscriptionNew Subscription data
Destroy
Destroy subscription account.
The instruction transfers funds from the subscription account to the subscriber, marking the subscription account as removable.
This instruction does not emit any logs.
Implementations§
Source§impl SubscriberInstruction
impl SubscriberInstruction
Sourcepub fn subscribe_to(
signer: Pubkey,
nonce: Nonce,
handler: Subscription,
) -> Instruction
pub fn subscribe_to( signer: Pubkey, nonce: Nonce, handler: Subscription, ) -> Instruction
Create a SubscriberInstruction::SubscribeToEvent Instruction
§Account references
[SIGNER]Signer (subscriber) account[WRITE]Subscription data account[READONLY]System program account
§Arguments
signer- The public key of the subscribernonce- The nonce to differentiate handlers for the same topic/signer pairhandler- TheSubscriptiondata
§Returns
Instruction- An SVM instruction to be included in a transaction
Sourcepub fn unsubscribe_from(signer: Pubkey, nonce: Nonce) -> Instruction
pub fn unsubscribe_from(signer: Pubkey, nonce: Nonce) -> Instruction
Create a SubscriberInstruction::Unsubscribe Instruction
§Account references
[SIGNER]Signer (subscriber) account[WRITE]Subscription data account
§Arguments
signer- The public key of the subscribernonce- The nonce to differentiate handlers for the same topic/signer pair
§Returns
Instruction- An SVM instruction to be included in a transaction
Sourcepub fn update(
signer: Pubkey,
nonce: Nonce,
handler: Subscription,
) -> Instruction
pub fn update( signer: Pubkey, nonce: Nonce, handler: Subscription, ) -> Instruction
Create a SubscriberInstruction::Update Instruction.
§Account references
[SIGNER]Signer (subscriber) account[WRITE]Subscription data account[READONLY]System program account
§Arguments
signer- The public key of the subscribernonce- The nonce set during subscription to differentiate handlers for the same topic/signer pairhandler- TheSubscriptiondata
§Returns
Instruction- An SVM instruction to be included in a transaction
Trait Implementations§
Source§impl Clone for SubscriberInstruction
impl Clone for SubscriberInstruction
Source§fn clone(&self) -> SubscriberInstruction
fn clone(&self) -> SubscriberInstruction
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 Debug for SubscriberInstruction
impl Debug for SubscriberInstruction
Source§impl<'de> Deserialize<'de> for SubscriberInstruction
impl<'de> Deserialize<'de> for SubscriberInstruction
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 PartialEq for SubscriberInstruction
impl PartialEq for SubscriberInstruction
Source§impl Serialize for SubscriberInstruction
impl Serialize for SubscriberInstruction
impl Eq for SubscriberInstruction
impl StructuralPartialEq for SubscriberInstruction
Auto Trait Implementations§
impl Freeze for SubscriberInstruction
impl RefUnwindSafe for SubscriberInstruction
impl Send for SubscriberInstruction
impl Sync for SubscriberInstruction
impl Unpin for SubscriberInstruction
impl UnsafeUnpin for SubscriberInstruction
impl UnwindSafe for SubscriberInstruction
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<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.