Skip to main content

MessageBusConfigBuilder

Struct MessageBusConfigBuilder 

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

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

Implementations§

Source§

impl<S: State> MessageBusConfigBuilder<S>

Source

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

Finish building and return the requested object

Source

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

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

Source

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

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

Source

pub fn encoding( self, value: SerializationEncoding, ) -> MessageBusConfigBuilder<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>, ) -> MessageBusConfigBuilder<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, ) -> MessageBusConfigBuilder<SetTimestampsAsIso8601<S>>
where S::TimestampsAsIso8601: IsUnset,

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

If timestamps should be persisted as ISO 8601 strings. If false, then timestamps will be persisted as UNIX nanoseconds.

Source

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

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

If timestamps should be persisted as ISO 8601 strings. If false, then timestamps will be persisted as UNIX nanoseconds.

Source

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

Optional (Some / Option setters). The buffer interval (milliseconds) between pipelined/batched transactions. The recommended range if using buffered pipelining is [10, 1000] milliseconds, with a good compromise being 100 milliseconds.

Source

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

Optional (Some / Option setters). The buffer interval (milliseconds) between pipelined/batched transactions. The recommended range if using buffered pipelining is [10, 1000] milliseconds, with a good compromise being 100 milliseconds.

Source

pub fn autotrim_mins( self, value: u32, ) -> MessageBusConfigBuilder<SetAutotrimMins<S>>
where S::AutotrimMins: IsUnset,

Optional (Some / Option setters). The lookback window in minutes for automatic stream trimming. The actual window may extend up to one minute beyond the specified value since streams are trimmed at most once every minute. This feature requires Redis version 6.2 or higher; otherwise, it will result in a command syntax error.

Source

pub fn maybe_autotrim_mins( self, value: Option<u32>, ) -> MessageBusConfigBuilder<SetAutotrimMins<S>>
where S::AutotrimMins: IsUnset,

Optional (Some / Option setters). The lookback window in minutes for automatic stream trimming. The actual window may extend up to one minute beyond the specified value since streams are trimmed at most once every minute. This feature requires Redis version 6.2 or higher; otherwise, it will result in a command syntax error.

Source

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

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

If a ‘trader-’ prefix is used for stream names.

Source

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

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

If a ‘trader-’ prefix is used for stream names.

Source

pub fn use_trader_id( self, value: bool, ) -> MessageBusConfigBuilder<SetUseTraderId<S>>
where S::UseTraderId: IsUnset,

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

If the trader’s ID is used for stream names.

Source

pub fn maybe_use_trader_id( self, value: Option<bool>, ) -> MessageBusConfigBuilder<SetUseTraderId<S>>
where S::UseTraderId: IsUnset,

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

If the trader’s ID is used for stream names.

Source

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

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

If the trader’s instance ID is used for stream names. Default is false.

Source

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

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

If the trader’s instance ID is used for stream names. Default is false.

Source

pub fn streams_prefix( self, value: String, ) -> MessageBusConfigBuilder<SetStreamsPrefix<S>>
where S::StreamsPrefix: IsUnset,

Optional (Some / Option setters). Default: "stream".to_string().

The prefix for externally published stream names. Must have a database config.

Source

pub fn maybe_streams_prefix( self, value: Option<String>, ) -> MessageBusConfigBuilder<SetStreamsPrefix<S>>
where S::StreamsPrefix: IsUnset,

Optional (Some / Option setters). Default: "stream".to_string().

The prefix for externally published stream names. Must have a database config.

Source

pub fn stream_per_topic( self, value: bool, ) -> MessageBusConfigBuilder<SetStreamPerTopic<S>>
where S::StreamPerTopic: IsUnset,

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

If true, messages will be written to separate streams per topic. If false, all messages will be written to the same stream.

Source

pub fn maybe_stream_per_topic( self, value: Option<bool>, ) -> MessageBusConfigBuilder<SetStreamPerTopic<S>>
where S::StreamPerTopic: IsUnset,

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

If true, messages will be written to separate streams per topic. If false, all messages will be written to the same stream.

Source

pub fn external_streams( self, value: Vec<String>, ) -> MessageBusConfigBuilder<SetExternalStreams<S>>
where S::ExternalStreams: IsUnset,

Optional (Some / Option setters). The external stream keys the message bus will listen to for publishing deserialized message payloads internally.

Source

pub fn maybe_external_streams( self, value: Option<Vec<String>>, ) -> MessageBusConfigBuilder<SetExternalStreams<S>>
where S::ExternalStreams: IsUnset,

Optional (Some / Option setters). The external stream keys the message bus will listen to for publishing deserialized message payloads internally.

Source

pub fn types_filter( self, value: Vec<String>, ) -> MessageBusConfigBuilder<SetTypesFilter<S>>
where S::TypesFilter: IsUnset,

Optional (Some / Option setters). A list of serializable types not to publish externally.

Source

pub fn maybe_types_filter( self, value: Option<Vec<String>>, ) -> MessageBusConfigBuilder<SetTypesFilter<S>>
where S::TypesFilter: IsUnset,

Optional (Some / Option setters). A list of serializable types not to publish externally.

Source

pub fn heartbeat_interval_secs( self, value: u16, ) -> MessageBusConfigBuilder<SetHeartbeatIntervalSecs<S>>
where S::HeartbeatIntervalSecs: IsUnset,

Optional (Some / Option setters). The heartbeat interval (seconds).

Source

pub fn maybe_heartbeat_interval_secs( self, value: Option<u16>, ) -> MessageBusConfigBuilder<SetHeartbeatIntervalSecs<S>>
where S::HeartbeatIntervalSecs: IsUnset,

Optional (Some / Option setters). The heartbeat interval (seconds).

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.

§

impl<T> Instrument for T

§

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

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

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

§

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