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. A single session must start exactly at an available range’s bundle_start_slot. A parallel run may start inside a range; its first session then starts at that range’s bundle_start_slot.

Source

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

Required.

Last slot (inclusive) to replay, at most the range’s max_bundle_end_slot.

Source

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

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

Send a SessionSummary with completed. Default false: completed carries none.

Source

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

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

Send a SessionSummary with completed. Default false: completed carries none.

Source

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

Optional (Some / Option setters). Reroute historical swaps. Absent: plain replay.

Source

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

Optional (Some / Option setters). Reroute historical swaps. Absent: plain replay.

Source

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

Optional (Some / Option setters). Seconds to keep retrying while the server has no capacity for a new session, before failing the create. Unset or 0: fail at once when the server is busy.

Source

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

Optional (Some / Option setters). Seconds to keep retrying while the server has no capacity for a new session, before failing the create. Unset or 0: fail at once when the server is busy.

Source

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

Optional (Some / Option setters). Seconds the session waits for you to reattach after the session control channel drops. Unset: 30 (900 for a parallel run). 0: the session ends with the connection and responses carry no sequence number; otherwise they are wrapped in a SequencedResponse. Clamped to MAX_DISCONNECT_TIMEOUT_SECS (900 seconds).

Source

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

Optional (Some / Option setters). Seconds the session waits for you to reattach after the session control channel drops. Unset: 30 (900 for a parallel run). 0: the session ends with the connection and responses carry no sequence number; otherwise they are wrapped in a SequencedResponse. Clamped to MAX_DISCONNECT_TIMEOUT_SECS (900 seconds).

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: no discoveryBatch events.

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: no discoveryBatch events.

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 recorded account state for this range instead of executing its transactions, which is faster. Needs an account-state bundle for the range (BundleKind::AccountState). Nothing executes, so sending transactions, kind: send actions and transaction lookups are rejected; simulations still work.

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 recorded account state for this range instead of executing its transactions, which is faster. Needs an account-state bundle for the range (BundleKind::AccountState). Nothing executes, so sending transactions, kind: send actions and transaction lookups are rejected; simulations still work.

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().

Markets to probe through the router as the session runs, streamed over diagnosticSubscribe.

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().

Markets to probe through the router as the session runs, streamed over diagnosticSubscribe.

Auto Trait Implementations§

§

impl<S> Forget for CreateSessionParamsBuilder<S>

§

impl<S> Freeze for CreateSessionParamsBuilder<S>
where PhantomData<(fn() -> S, fn() -> PhantomData<CreateSessionParams>)>: Freeze, *const LeafNode<SwapAggregator, SetValZST> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(SwapAggregator, SetValZST)>>: Freeze, *const LeafNode<SwapScope, SetValZST> is !null: Freeze, PhantomData<Box<(SwapScope, SetValZST)>>: Freeze, *const LeafNode<MintPair, SetValZST> is !null: Freeze, PhantomData<Box<(MintPair, SetValZST)>>: Freeze, *const u8 is !null: Freeze, PhantomData<VenueTemplate>: Freeze, *const LeafNode<Address, SetValZST> is !null: Freeze, PhantomData<Box<(Address, SetValZST)>>: Freeze, PhantomData<DiscoveryFilter>: Freeze, PhantomData<ScheduledAction>: Freeze, PhantomData<DiagnosticProbeParams>: Freeze,

§

impl<S> Move for CreateSessionParamsBuilder<S>

§

impl<S> RefUnwindSafe for CreateSessionParamsBuilder<S>

§

impl<S> Send for CreateSessionParamsBuilder<S>
where NodeRef<Owned, SwapAggregator, SetValZST, LeafOrInternal>: Send, BoxRaw<(SwapAggregator, SetValZST)>: Send, NodeRef<Owned, SwapScope, SetValZST, LeafOrInternal>: Send, BoxRaw<(SwapScope, SetValZST)>: Send, NodeRef<Owned, MintPair, SetValZST, LeafOrInternal>: Send, BoxRaw<(MintPair, SetValZST)>: Send, RawVecInner: Send, NodeRef<Owned, Address, SetValZST, LeafOrInternal>: Send, BoxRaw<(Address, SetValZST)>: Send, NonZero<u64>: Send, NodeRef<Owned, Address, AccountData, LeafOrInternal>: Send, BoxRaw<(Address, AccountData)>: Send,

§

impl<S> Sync for CreateSessionParamsBuilder<S>
where NodeRef<Owned, SwapAggregator, SetValZST, LeafOrInternal>: Sync, BoxRaw<(SwapAggregator, SetValZST)>: Sync, NodeRef<Owned, SwapScope, SetValZST, LeafOrInternal>: Sync, BoxRaw<(SwapScope, SetValZST)>: Sync, NodeRef<Owned, MintPair, SetValZST, LeafOrInternal>: Sync, BoxRaw<(MintPair, SetValZST)>: Sync, RawVecInner: Sync, NodeRef<Owned, Address, SetValZST, LeafOrInternal>: Sync, BoxRaw<(Address, SetValZST)>: Sync, NonZero<u64>: Sync, NodeRef<Owned, Address, AccountData, LeafOrInternal>: Sync, BoxRaw<(Address, AccountData)>: Sync,

§

impl<S> Unpin for CreateSessionParamsBuilder<S>
where *const LeafNode<SwapAggregator, SetValZST> is !null: Unpin, Box<(SwapAggregator, SetValZST)>: Unpin, *const LeafNode<SwapScope, SetValZST> is !null: Unpin, Box<(SwapScope, SetValZST)>: Unpin, *const LeafNode<MintPair, SetValZST> is !null: Unpin, Box<(MintPair, SetValZST)>: Unpin, *const u8 is !null: Unpin, *const LeafNode<Address, SetValZST> is !null: Unpin, Box<(Address, SetValZST)>: Unpin, NonZero<u64>: Unpin, *const LeafNode<Address, AccountData> is !null: Unpin, Box<(Address, AccountData)>: Unpin,

§

impl<S> UnsafeUnpin for CreateSessionParamsBuilder<S>

§

impl<S> UnwindSafe for CreateSessionParamsBuilder<S>

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