pub struct PersistentSubscriptionBuilder { /* private fields */ }Expand description
Builder for configuring and creating a persistent subscription. This provides a fluent interface for setting up a persistent subscription with proper CString handling.
Implementations§
Source§impl PersistentSubscriptionBuilder
impl PersistentSubscriptionBuilder
Sourcepub fn new() -> Result<Self, AeronCError>
pub fn new() -> Result<Self, AeronCError>
Create a new builder with a default context.
Sourcepub fn aeron(self, aeron: &Aeron) -> Result<Self, AeronCError>
pub fn aeron(self, aeron: &Aeron) -> Result<Self, AeronCError>
Set the Aeron client to use.
Sourcepub fn archive_context(
self,
ctx: &AeronArchiveContext,
) -> Result<Self, AeronCError>
pub fn archive_context( self, ctx: &AeronArchiveContext, ) -> Result<Self, AeronCError>
Set the archive context to use.
Sourcepub fn live_channel(self, channel: &str) -> Result<Self, AeronCError>
pub fn live_channel(self, channel: &str) -> Result<Self, AeronCError>
Set the live channel (accepts &str, handles CString conversion internally).
Sourcepub fn live_stream_id(self, id: i32) -> Result<Self, AeronCError>
pub fn live_stream_id(self, id: i32) -> Result<Self, AeronCError>
Set the live stream ID.
Sourcepub fn replay_channel(self, channel: &str) -> Result<Self, AeronCError>
pub fn replay_channel(self, channel: &str) -> Result<Self, AeronCError>
Set the replay channel (accepts &str, handles CString conversion internally).
Sourcepub fn replay_stream_id(self, id: i32) -> Result<Self, AeronCError>
pub fn replay_stream_id(self, id: i32) -> Result<Self, AeronCError>
Set the replay stream ID.
Sourcepub fn start_position(self, pos: i64) -> Result<Self, AeronCError>
pub fn start_position(self, pos: i64) -> Result<Self, AeronCError>
Set the start position.
Sourcepub fn start_from_beginning(self) -> Result<Self, AeronCError>
pub fn start_from_beginning(self) -> Result<Self, AeronCError>
Replay from the beginning of the recording (Aeron FROM_START).
Sourcepub fn start_from_live(self) -> Result<Self, AeronCError>
pub fn start_from_live(self) -> Result<Self, AeronCError>
Skip replay and join the live stream immediately (Aeron FROM_LIVE).
Sourcepub fn recording_id(self, id: i64) -> Result<Self, AeronCError>
pub fn recording_id(self, id: i64) -> Result<Self, AeronCError>
Set the recording ID.
Sourcepub fn listener<L: PersistentSubscriptionListener>(
self,
listener: L,
) -> Result<Self, AeronCError>
pub fn listener<L: PersistentSubscriptionListener>( self, listener: L, ) -> Result<Self, AeronCError>
Set the listener for events.
Sourcepub fn state_counter(self, counter: &AeronCounter) -> Result<Self, AeronCError>
pub fn state_counter(self, counter: &AeronCounter) -> Result<Self, AeronCError>
Pre-allocate the state counter so an external observer can read the PS state-machine
state. If unset the PS allocates one itself. Maps to Aeron’s Context.stateCounter.
Sourcepub fn join_difference_counter(
self,
counter: &AeronCounter,
) -> Result<Self, AeronCError>
pub fn join_difference_counter( self, counter: &AeronCounter, ) -> Result<Self, AeronCError>
Counter holding the byte gap between replay and live when the live image is added.
Maps to Aeron’s Context.joinDifferenceCounter.
Sourcepub fn live_left_counter(
self,
counter: &AeronCounter,
) -> Result<Self, AeronCError>
pub fn live_left_counter( self, counter: &AeronCounter, ) -> Result<Self, AeronCError>
Counter holding the number of times the PS has dropped off the live stream.
Maps to Aeron’s Context.liveLeftCounter.
Sourcepub fn live_joined_counter(
self,
counter: &AeronCounter,
) -> Result<Self, AeronCError>
pub fn live_joined_counter( self, counter: &AeronCounter, ) -> Result<Self, AeronCError>
Counter holding the number of times the PS has switched to the live stream.
Maps to Aeron’s Context.liveJoinedCounter.
Sourcepub fn build(self) -> Result<AeronArchivePersistentSubscription, AeronCError>
pub fn build(self) -> Result<AeronArchivePersistentSubscription, AeronCError>
Build the persistent subscription.