Skip to main content

CreateSessionParamsBuilder

Struct CreateSessionParamsBuilder 

Source
pub struct CreateSessionParamsBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> CreateSessionParamsBuilder<S>

Source

pub fn build(self) -> CreateSessionParams
where S: IsComplete,

Finish building and return the requested object

Source

pub fn start_slot( self, value: u64, ) -> CreateSessionParamsBuilder<SetStartSlot<S>>
where S::StartSlot: IsUnset,

Required.

First slot (inclusive) to replay.

Source

pub fn end_slot(self, value: u64) -> CreateSessionParamsBuilder<SetEndSlot<S>>
where S::EndSlot: IsUnset,

Required.

Last slot (inclusive) to replay.

Source

pub fn send_summary( self, value: bool, ) -> CreateSessionParamsBuilder<SetSendSummary<S>>
where S::SendSummary: IsUnset,

Optional (Some / Option setters). Default: false.

When true, include a session summary with transaction statistics in client-facing Completed responses. Summary generation remains enabled internally for metrics.

Source

pub fn maybe_send_summary( self, value: Option<bool>, ) -> CreateSessionParamsBuilder<SetSendSummary<S>>
where S::SendSummary: IsUnset,

Optional (Some / Option setters). Default: false.

When true, include a session summary with transaction statistics in client-facing Completed responses. Summary generation remains enabled internally for metrics.

Source

pub fn reroute( self, value: RerouteParams, ) -> CreateSessionParamsBuilder<SetReroute<S>>
where S::Reroute: IsUnset,

Optional (Some / Option setters). Re-quote historical swaps through the metis router. Absent: plain replay.

Source

pub fn maybe_reroute( self, value: Option<RerouteParams>, ) -> CreateSessionParamsBuilder<SetReroute<S>>
where S::Reroute: IsUnset,

Optional (Some / Option setters). Re-quote historical swaps through the metis router. Absent: plain replay.

Source

pub fn capacity_wait_timeout_secs( self, value: u16, ) -> CreateSessionParamsBuilder<SetCapacityWaitTimeoutSecs<S>>
where S::CapacityWaitTimeoutSecs: IsUnset,

Optional (Some / Option setters). Maximum seconds to wait for ECS capacity-related startup retries before failing session creation. If not set (or 0), capacity errors fail immediately.

Source

pub fn maybe_capacity_wait_timeout_secs( self, value: Option<u16>, ) -> CreateSessionParamsBuilder<SetCapacityWaitTimeoutSecs<S>>
where S::CapacityWaitTimeoutSecs: IsUnset,

Optional (Some / Option setters). Maximum seconds to wait for ECS capacity-related startup retries before failing session creation. If not set (or 0), capacity errors fail immediately.

Source

pub fn disconnect_timeout_secs( self, value: u16, ) -> CreateSessionParamsBuilder<SetDisconnectTimeoutSecs<S>>
where S::DisconnectTimeoutSecs: IsUnset,

Optional (Some / Option setters). Maximum seconds to keep the session alive after the control websocket disconnects. If not set (or 0), the session tears down immediately on disconnect. Clamped to MAX_DISCONNECT_TIMEOUT_SECS (900 seconds / 15 minutes).

Source

pub fn maybe_disconnect_timeout_secs( self, value: Option<u16>, ) -> CreateSessionParamsBuilder<SetDisconnectTimeoutSecs<S>>
where S::DisconnectTimeoutSecs: IsUnset,

Optional (Some / Option setters). Maximum seconds to keep the session alive after the control websocket disconnects. If not set (or 0), the session tears down immediately on disconnect. Clamped to MAX_DISCONNECT_TIMEOUT_SECS (900 seconds / 15 minutes).

Source

pub fn extra_compute_units( self, value: u32, ) -> CreateSessionParamsBuilder<SetExtraComputeUnits<S>>
where S::ExtraComputeUnits: IsUnset,

Optional (Some / Option setters). Extra compute units to add to each transaction’s SetComputeUnitLimit budget. Useful when replaying with an account override whose program uses more CU than the original, causing otherwise-healthy transactions to run out of budget. Only applied when a SetComputeUnitLimit instruction is already present.

Source

pub fn maybe_extra_compute_units( self, value: Option<u32>, ) -> CreateSessionParamsBuilder<SetExtraComputeUnits<S>>
where S::ExtraComputeUnits: IsUnset,

Optional (Some / Option setters). Extra compute units to add to each transaction’s SetComputeUnitLimit budget. Useful when replaying with an account override whose program uses more CU than the original, causing otherwise-healthy transactions to run out of budget. Only applied when a SetComputeUnitLimit instruction is already present.

Source

pub fn discoveries( self, value: Vec<DiscoveryFilter>, ) -> CreateSessionParamsBuilder<SetDiscoveries<S>>
where S::Discoveries: IsUnset,

Optional (Some / Option setters). Default: <Vec<DiscoveryFilter> as Default>::default().

Events of interest the session should watch for. When an upcoming batch matches any filter, the server emits BacktestResponse::DiscoveryBatch (and its session-event twins) ahead of execution so the client can follow up with BacktestRequest::ContinueTo to pause before the batch. Empty means no batch discoveries are performed (existing behaviour).

Source

pub fn maybe_discoveries( self, value: Option<Vec<DiscoveryFilter>>, ) -> CreateSessionParamsBuilder<SetDiscoveries<S>>
where S::Discoveries: IsUnset,

Optional (Some / Option setters). Default: <Vec<DiscoveryFilter> as Default>::default().

Events of interest the session should watch for. When an upcoming batch matches any filter, the server emits BacktestResponse::DiscoveryBatch (and its session-event twins) ahead of execution so the client can follow up with BacktestRequest::ContinueTo to pause before the batch. Empty means no batch discoveries are performed (existing behaviour).

Source

pub fn actions( self, value: Vec<ScheduledAction>, ) -> CreateSessionParamsBuilder<SetActions<S>>
where S::Actions: IsUnset,

Optional (Some / Option setters). Default: <Vec<ScheduledAction> as Default>::default().

Transactions the server runs automatically during the backtest, with results streamed over actionSubscribe.

Compressed as a whole rather than per action: a per-slot schedule repeats near-identical account bytes thousands of times, and that redundancy is only visible across actions. Compressing each action alone leaves a 10k-slot schedule near the websocket message limit; compressing the vector takes the same schedule from ~28 MiB to ~1 MiB.

Source

pub fn maybe_actions( self, value: Option<Vec<ScheduledAction>>, ) -> CreateSessionParamsBuilder<SetActions<S>>
where S::Actions: IsUnset,

Optional (Some / Option setters). Default: <Vec<ScheduledAction> as Default>::default().

Transactions the server runs automatically during the backtest, with results streamed over actionSubscribe.

Compressed as a whole rather than per action: a per-slot schedule repeats near-identical account bytes thousands of times, and that redundancy is only visible across actions. Compressing each action alone leaves a 10k-slot schedule near the websocket message limit; compressing the vector takes the same schedule from ~28 MiB to ~1 MiB.

Source

pub fn replay_account_state( self, value: bool, ) -> CreateSessionParamsBuilder<SetReplayAccountState<S>>
where S::ReplayAccountState: IsUnset,

Optional (Some / Option setters). Default: false.

Replay accounts states for this range instead of executing transactions — a state-only acceleration.

Source

pub fn maybe_replay_account_state( self, value: Option<bool>, ) -> CreateSessionParamsBuilder<SetReplayAccountState<S>>
where S::ReplayAccountState: IsUnset,

Optional (Some / Option setters). Default: false.

Replay accounts states for this range instead of executing transactions — a state-only acceleration.

Source

pub fn diagnostic_probes( self, value: Vec<DiagnosticProbeParams>, ) -> CreateSessionParamsBuilder<SetDiagnosticProbes<S>>
where S::DiagnosticProbes: IsUnset,

Optional (Some / Option setters). Default: <Vec<DiagnosticProbeParams> as Default>::default().

Source

pub fn maybe_diagnostic_probes( self, value: Option<Vec<DiagnosticProbeParams>>, ) -> CreateSessionParamsBuilder<SetDiagnosticProbes<S>>
where S::DiagnosticProbes: IsUnset,

Optional (Some / Option setters). Default: <Vec<DiagnosticProbeParams> as Default>::default().

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V