Skip to main content

TriggerData

Enum TriggerData 

Source
pub enum TriggerData {
    CosmosContractEvent {
        contract_address: CosmosAddr,
        chain: ChainKey,
        event: Event,
        block_height: u64,
        event_index: u64,
    },
    EvmContractEvent {
        chain: ChainKey,
        contract_address: Address,
        log_data: LogData,
        tx_hash: TxHash,
        block_number: u64,
        log_index: u64,
        block_hash: B256,
        block_timestamp: Option<u64>,
        tx_index: u64,
    },
    BlockInterval {
        chain: ChainKey,
        block_height: u64,
    },
    Cron {
        trigger_time: Timestamp,
    },
    AtProtoEvent {
        sequence: i64,
        timestamp: i64,
        repo: String,
        collection: String,
        rkey: String,
        action: AtProtoAction,
        cid: Option<String>,
        record: Option<Value>,
        rev: Option<String>,
        op_index: Option<u32>,
    },
    HypercoreAppend {
        feed_key: String,
        index: u64,
        data: Vec<u8>,
    },
    Raw(Vec<u8>),
}
Expand description

The data that came from the trigger and is passed to the component after being converted into the WIT-friendly type

Variants§

§

CosmosContractEvent

Fields

§contract_address: CosmosAddr

The address of the contract that emitted the event

§chain: ChainKey

The chain where the event was emitted

§event: Event

The data that was emitted by the contract

§block_height: u64

The block height where the event was emitted

§event_index: u64

The index of the event in this block, required for unique identification

§

EvmContractEvent

Fields

§chain: ChainKey

The chain where the event was emitted

§contract_address: Address

The address of the contract that emitted the event

§log_data: LogData

The log data

§tx_hash: TxHash

The transaction hash where the event was emitted

§block_number: u64

The block height where the event was emitted

§log_index: u64

The index of the log in the block

§block_hash: B256

Hash of the block the transaction that emitted this log was mined in

§block_timestamp: Option<u64>

The timestamp of the block containing this event, as proposed in https://github.com/ethereum/execution-apis/issues/295 This field is optional since nodes are not required to include it in event logs. If not provided, applications may need to fetch the block header directly to obtain the timestamp.

§tx_index: u64

Index of the Transaction in the block

§

BlockInterval

Fields

§chain: ChainKey

The chain where the blocks are checked

§block_height: u64

The block height where the event was emitted

§

Cron

Fields

§trigger_time: Timestamp

The trigger time

§

AtProtoEvent

ATProto Jetstream event data

Fields

§sequence: i64

Sequence number of the event in the stream

§timestamp: i64

Timestamp in microseconds

§repo: String

Repository DID that generated the event

§collection: String

Collection NSID (e.g., “app.bsky.feed.post”)

§rkey: String

Record key within the collection

§action: AtProtoAction

Action type (create, update, delete)

§cid: Option<String>

CID of the record (None for delete events)

§record: Option<Value>

Record data as JSON (None for delete events)

§rev: Option<String>

Repository revision identifier for this commit (if provided by the event)

§op_index: Option<u32>

Index of the operation within the commit (0-based)

§

HypercoreAppend

Fields

§feed_key: String

Hypercore feed key that emitted the append

§index: u64

Index of the appended entry

§data: Vec<u8>

Raw entry data

§

Raw(Vec<u8>)

Implementations§

Source§

impl TriggerData

Source

pub fn new_raw(data: impl AsRef<[u8]>) -> Self

Source

pub fn trigger_type(&self) -> &str

Source

pub fn chain(&self) -> Option<&ChainKey>

Trait Implementations§

Source§

impl Clone for TriggerData

Source§

fn clone(&self) -> TriggerData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for TriggerData

Source§

impl Debug for TriggerData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TriggerData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TriggerData

Source§

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 Eq for TriggerData

Source§

impl PartialEq for TriggerData

Source§

fn eq(&self, other: &TriggerData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TriggerData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TriggerData

Source§

impl ToSchema for TriggerData

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V