Skip to main content

CacheConfigBuilder

Struct CacheConfigBuilder 

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

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

Implementations§

Source§

impl<S: State> CacheConfigBuilder<S>

Source

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

Finish building and return the requested object

Source

pub fn database( self, value: DatabaseConfig, ) -> CacheConfigBuilder<SetDatabase<S>>
where S::Database: IsUnset,

Optional (Some / Option setters). The configuration for the cache backing database.

Source

pub fn maybe_database( self, value: Option<DatabaseConfig>, ) -> CacheConfigBuilder<SetDatabase<S>>
where S::Database: IsUnset,

Optional (Some / Option setters). The configuration for the cache backing database.

Source

pub fn encoding( self, value: SerializationEncoding, ) -> CacheConfigBuilder<SetEncoding<S>>
where S::Encoding: IsUnset,

Optional (Some / Option setters). Default: SerializationEncoding::MsgPack.

The encoding for database operations, controls the type of serializer used.

Source

pub fn maybe_encoding( self, value: Option<SerializationEncoding>, ) -> CacheConfigBuilder<SetEncoding<S>>
where S::Encoding: IsUnset,

Optional (Some / Option setters). Default: SerializationEncoding::MsgPack.

The encoding for database operations, controls the type of serializer used.

Source

pub fn timestamps_as_iso8601( self, value: bool, ) -> CacheConfigBuilder<SetTimestampsAsIso8601<S>>
where S::TimestampsAsIso8601: IsUnset,

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

If timestamps should be persisted as ISO 8601 strings.

Source

pub fn maybe_timestamps_as_iso8601( self, value: Option<bool>, ) -> CacheConfigBuilder<SetTimestampsAsIso8601<S>>
where S::TimestampsAsIso8601: IsUnset,

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

If timestamps should be persisted as ISO 8601 strings.

Source

pub fn buffer_interval_ms( self, value: usize, ) -> CacheConfigBuilder<SetBufferIntervalMs<S>>
where S::BufferIntervalMs: IsUnset,

Optional (Some / Option setters). The buffer interval (milliseconds) between pipelined/batched transactions.

Source

pub fn maybe_buffer_interval_ms( self, value: Option<usize>, ) -> CacheConfigBuilder<SetBufferIntervalMs<S>>
where S::BufferIntervalMs: IsUnset,

Optional (Some / Option setters). The buffer interval (milliseconds) between pipelined/batched transactions.

Source

pub fn bulk_read_batch_size( self, value: usize, ) -> CacheConfigBuilder<SetBulkReadBatchSize<S>>
where S::BulkReadBatchSize: IsUnset,

Optional (Some / Option setters). The batch size for bulk read operations (e.g., MGET). If set, bulk reads will be batched into chunks of this size.

Source

pub fn maybe_bulk_read_batch_size( self, value: Option<usize>, ) -> CacheConfigBuilder<SetBulkReadBatchSize<S>>
where S::BulkReadBatchSize: IsUnset,

Optional (Some / Option setters). The batch size for bulk read operations (e.g., MGET). If set, bulk reads will be batched into chunks of this size.

Source

pub fn use_trader_prefix( self, value: bool, ) -> CacheConfigBuilder<SetUseTraderPrefix<S>>
where S::UseTraderPrefix: IsUnset,

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

If a ‘trader-’ prefix is used for keys.

Source

pub fn maybe_use_trader_prefix( self, value: Option<bool>, ) -> CacheConfigBuilder<SetUseTraderPrefix<S>>
where S::UseTraderPrefix: IsUnset,

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

If a ‘trader-’ prefix is used for keys.

Source

pub fn use_instance_id( self, value: bool, ) -> CacheConfigBuilder<SetUseInstanceId<S>>
where S::UseInstanceId: IsUnset,

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

If the trader’s instance ID is used for keys.

Source

pub fn maybe_use_instance_id( self, value: Option<bool>, ) -> CacheConfigBuilder<SetUseInstanceId<S>>
where S::UseInstanceId: IsUnset,

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

If the trader’s instance ID is used for keys.

Source

pub fn flush_on_start( self, value: bool, ) -> CacheConfigBuilder<SetFlushOnStart<S>>
where S::FlushOnStart: IsUnset,

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

If the database should be flushed on start.

Source

pub fn maybe_flush_on_start( self, value: Option<bool>, ) -> CacheConfigBuilder<SetFlushOnStart<S>>
where S::FlushOnStart: IsUnset,

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

If the database should be flushed on start.

Source

pub fn drop_instruments_on_reset( self, value: bool, ) -> CacheConfigBuilder<SetDropInstrumentsOnReset<S>>
where S::DropInstrumentsOnReset: IsUnset,

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

If instrument data should be dropped from the cache’s memory on reset.

Source

pub fn maybe_drop_instruments_on_reset( self, value: Option<bool>, ) -> CacheConfigBuilder<SetDropInstrumentsOnReset<S>>
where S::DropInstrumentsOnReset: IsUnset,

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

If instrument data should be dropped from the cache’s memory on reset.

Source

pub fn tick_capacity( self, value: usize, ) -> CacheConfigBuilder<SetTickCapacity<S>>
where S::TickCapacity: IsUnset,

Optional (Some / Option setters). Default: 10_000.

The maximum length for internal tick deques.

Source

pub fn maybe_tick_capacity( self, value: Option<usize>, ) -> CacheConfigBuilder<SetTickCapacity<S>>
where S::TickCapacity: IsUnset,

Optional (Some / Option setters). Default: 10_000.

The maximum length for internal tick deques.

Source

pub fn bar_capacity(self, value: usize) -> CacheConfigBuilder<SetBarCapacity<S>>
where S::BarCapacity: IsUnset,

Optional (Some / Option setters). Default: 10_000.

The maximum length for internal bar deques.

Source

pub fn maybe_bar_capacity( self, value: Option<usize>, ) -> CacheConfigBuilder<SetBarCapacity<S>>
where S::BarCapacity: IsUnset,

Optional (Some / Option setters). Default: 10_000.

The maximum length for internal bar deques.

Source

pub fn save_market_data( self, value: bool, ) -> CacheConfigBuilder<SetSaveMarketData<S>>
where S::SaveMarketData: IsUnset,

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

If market data should be persisted to disk.

Source

pub fn maybe_save_market_data( self, value: Option<bool>, ) -> CacheConfigBuilder<SetSaveMarketData<S>>
where S::SaveMarketData: IsUnset,

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

If market data should be persisted to disk.

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

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Ungil for T
where T: Send,