Skip to main content

OpCode

Enum OpCode 

Source
pub enum OpCode {
Show 36 variants AbortIfNullKey { key: Register, is_account_event: bool, }, LoadEventField { path: FieldPath, dest: Register, default: Option<Value>, }, LoadConstant { value: Value, dest: Register, }, CopyRegister { source: Register, dest: Register, }, CopyRegisterIfNull { source: Register, dest: Register, }, GetEventType { dest: Register, }, CreateObject { dest: Register, }, SetField { object: Register, path: String, value: Register, }, SetFields { object: Register, fields: Vec<(String, Register)>, }, GetField { object: Register, path: String, dest: Register, }, ReadOrInitState { state_id: u32, key: Register, default: Value, dest: Register, }, UpdateState { state_id: u32, key: Register, value: Register, }, AppendToArray { object: Register, path: String, value: Register, }, GetCurrentTimestamp { dest: Register, }, CreateEvent { dest: Register, event_value: Register, }, CreateCapture { dest: Register, capture_value: Register, }, Transform { source: Register, dest: Register, transformation: Transformation, }, EmitMutation { entity_name: String, key: Register, state: Register, }, SetFieldIfNull { object: Register, path: String, value: Register, }, SetFieldMax { object: Register, path: String, value: Register, }, UpdateTemporalIndex { state_id: u32, index_name: String, lookup_value: Register, primary_key: Register, timestamp: Register, }, LookupTemporalIndex { state_id: u32, index_name: String, lookup_value: Register, timestamp: Register, dest: Register, }, UpdateLookupIndex { state_id: u32, index_name: String, lookup_value: Register, primary_key: Register, }, LookupIndex { state_id: u32, index_name: String, lookup_value: Register, dest: Register, }, SetFieldSum { object: Register, path: String, value: Register, }, SetFieldIncrement { object: Register, path: String, }, SetFieldMin { object: Register, path: String, value: Register, }, SetFieldWhen { object: Register, path: String, value: Register, when_instruction: String, entity_name: String, key_reg: Register, condition_field: Option<FieldPath>, condition_op: Option<ComparisonOp>, condition_value: Option<Value>, }, SetFieldUnlessStopped { object: Register, path: String, value: Register, stop_field: String, stop_instruction: String, entity_name: String, key_reg: Register, }, AddToUniqueSet { state_id: u32, set_name: String, value: Register, count_object: Register, count_path: String, }, ConditionalSetField { object: Register, path: String, value: Register, condition_field: FieldPath, condition_op: ComparisonOp, condition_value: Value, }, ConditionalIncrement { object: Register, path: String, condition_field: FieldPath, condition_op: ComparisonOp, condition_value: Value, }, EvaluateComputedFields { state: Register, computed_paths: Vec<String>, }, QueueResolver { state_id: u32, entity_name: String, resolver: ResolverType, input_path: Option<String>, input_value: Option<Value>, url_template: Option<Vec<UrlTemplatePart>>, strategy: ResolveStrategy, extracts: Vec<ResolverExtractSpec>, condition: Option<ResolverCondition>, schedule_at: Option<String>, state: Register, key: Register, }, UpdatePdaReverseLookup { state_id: u32, lookup_name: String, pda_address: Register, primary_key: Register, }, SegmentBoundary,
}

Variants§

§

AbortIfNullKey

Abort the handler with empty mutations when the key register is null and the event is an account-state update (not IxState / CpiEvent). Placed immediately after key resolution so that downstream opcodes (index updates, field mappings, resolvers, emit) never execute with a garbage key. The null-key event is then eligible for queueing by process_event’s miss-handling logic.

Fields

§is_account_event: bool
§

LoadEventField

Fields

§default: Option<Value>
§

LoadConstant

Fields

§value: Value
§

CopyRegister

Fields

§source: Register
§

CopyRegisterIfNull

Copy from source to dest only if dest is currently null

Fields

§source: Register
§

GetEventType

Fields

§

CreateObject

Fields

§

SetField

Fields

§object: Register
§path: String
§value: Register
§

SetFields

Fields

§object: Register
§fields: Vec<(String, Register)>
§

GetField

Fields

§object: Register
§path: String
§

ReadOrInitState

Fields

§state_id: u32
§default: Value
§

UpdateState

Fields

§state_id: u32
§value: Register
§

AppendToArray

Fields

§object: Register
§path: String
§value: Register
§

GetCurrentTimestamp

Load the Unix-seconds timestamp of the update being processed (its UpdateContext timestamp, else the wall clock). It is the update’s time, not the processing time, so a replay reproduces it.

Fields

§

CreateEvent

Wrap an event as {timestamp, data, slot?, signature?, event_index?, ix_path?}, stamped with the update’s timestamp.

Fields

§event_value: Register
§

CreateCapture

Wrap a captured account as {timestamp, account_address, data, slot?, signature?}, stamped with the update’s timestamp.

Fields

§capture_value: Register
§

Transform

Fields

§source: Register
§transformation: Transformation
§

EmitMutation

Fields

§entity_name: String
§state: Register
§

SetFieldIfNull

Fields

§object: Register
§path: String
§value: Register
§

SetFieldMax

Fields

§object: Register
§path: String
§value: Register
§

UpdateTemporalIndex

Fields

§state_id: u32
§index_name: String
§lookup_value: Register
§primary_key: Register
§timestamp: Register
§

LookupTemporalIndex

Fields

§state_id: u32
§index_name: String
§lookup_value: Register
§timestamp: Register
§

UpdateLookupIndex

Fields

§state_id: u32
§index_name: String
§lookup_value: Register
§primary_key: Register
§

LookupIndex

Fields

§state_id: u32
§index_name: String
§lookup_value: Register
§

SetFieldSum

Sum a numeric value to a field (accumulator)

Fields

§object: Register
§path: String
§value: Register
§

SetFieldIncrement

Increment a counter field by 1

Fields

§object: Register
§path: String
§

SetFieldMin

Set field to minimum value

Fields

§object: Register
§path: String
§value: Register
§

SetFieldWhen

Set field only if a specific instruction type was seen in the same transaction. If not seen yet, defers the operation for later completion.

Fields

§object: Register
§path: String
§value: Register
§when_instruction: String
§entity_name: String
§key_reg: Register
§condition_field: Option<FieldPath>
§condition_op: Option<ComparisonOp>
§condition_value: Option<Value>
§

SetFieldUnlessStopped

Set field unless stopped by a specific instruction. Stop is tracked by a per-entity stop flag.

Fields

§object: Register
§path: String
§value: Register
§stop_field: String
§stop_instruction: String
§entity_name: String
§key_reg: Register
§

AddToUniqueSet

Add value to unique set and update count Maintains internal Set, field stores count

Fields

§state_id: u32
§set_name: String
§value: Register
§count_object: Register
§count_path: String
§

ConditionalSetField

Conditionally set a field based on a comparison

Fields

§object: Register
§path: String
§value: Register
§condition_field: FieldPath
§condition_op: ComparisonOp
§condition_value: Value
§

ConditionalIncrement

Conditionally increment a field based on a comparison

Fields

§object: Register
§path: String
§condition_field: FieldPath
§condition_op: ComparisonOp
§condition_value: Value
§

EvaluateComputedFields

Evaluate computed fields (calls external hook if provided) computed_paths: List of paths that will be computed (for dirty tracking)

Fields

§state: Register
§computed_paths: Vec<String>
§

QueueResolver

Queue a resolver for asynchronous enrichment

Fields

§state_id: u32
§entity_name: String
§resolver: ResolverType
§input_path: Option<String>
§input_value: Option<Value>
§url_template: Option<Vec<UrlTemplatePart>>
§schedule_at: Option<String>
§state: Register
§

UpdatePdaReverseLookup

Update PDA reverse lookup table Maps a PDA address to its primary key for reverse lookups

Fields

§state_id: u32
§lookup_name: String
§pda_address: Register
§primary_key: Register
§

SegmentBoundary

Separates independently keyed handler segments for one event type.

When one event updates the same entity through different keys (for example split_position touching both its first_position and its second_position), each key gets its own segment: its own key loading, state read, mappings, state write and mutation. The VM runs segments in order and isolates them, so an early exit in one segment never skips another. Handlers with a single key never contain a boundary.

Trait Implementations§

Source§

impl Clone for OpCode

Source§

fn clone(&self) -> Self

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 Debug for OpCode

Source§

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

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

impl Serialize for OpCode

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

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more