Skip to main content

PersistentSubscriptionBuilder

Struct PersistentSubscriptionBuilder 

Source
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

Source

pub fn new() -> Result<Self, AeronCError>

Create a new builder with a default context.

Source

pub fn aeron(self, aeron: &Aeron) -> Result<Self, AeronCError>

Set the Aeron client to use.

Source

pub fn archive_context( self, ctx: &AeronArchiveContext, ) -> Result<Self, AeronCError>

Set the archive context to use.

Source

pub fn live_channel(self, channel: &str) -> Result<Self, AeronCError>

Set the live channel (accepts &str, handles CString conversion internally).

Source

pub fn live_stream_id(self, id: i32) -> Result<Self, AeronCError>

Set the live stream ID.

Source

pub fn replay_channel(self, channel: &str) -> Result<Self, AeronCError>

Set the replay channel (accepts &str, handles CString conversion internally).

Source

pub fn replay_stream_id(self, id: i32) -> Result<Self, AeronCError>

Set the replay stream ID.

Source

pub fn start_position(self, pos: i64) -> Result<Self, AeronCError>

Set the start position.

Source

pub fn start_from_beginning(self) -> Result<Self, AeronCError>

Replay from the beginning of the recording (Aeron FROM_START).

Source

pub fn start_from_live(self) -> Result<Self, AeronCError>

Skip replay and join the live stream immediately (Aeron FROM_LIVE).

Source

pub fn recording_id(self, id: i64) -> Result<Self, AeronCError>

Set the recording ID.

Source

pub fn listener<L: PersistentSubscriptionListener>( self, listener: L, ) -> Result<Self, AeronCError>

Set the listener for events.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn build(self) -> Result<AeronArchivePersistentSubscription, AeronCError>

Build the persistent subscription.

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