Skip to main content

AeronArchivePersistentSubscriptionContext

Struct AeronArchivePersistentSubscriptionContext 

Source
pub struct AeronArchivePersistentSubscriptionContext { /* private fields */ }

Implementations§

Source§

impl AeronArchivePersistentSubscriptionContext

Source

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

Create and initialize a persistent subscription context.

§Return

0 on success, -1 on error.

Source

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

Set the Aeron client that will be used by the persistent subscription.

If not set, the persistent subscription will create and own its own Aeron client when aeron_archive_persistent_subscription_create is called. In that case, the client will be closed when the context is closed via aeron_archive_persistent_subscription_context_close.

§Parameters
  • aeron the Aeron client to use.
§Return

0 on success, -1 on error.

Source

pub fn set_aeron_directory_name( &self, aeron_directory_name: &CStr, ) -> Result<i32, AeronCError>

Set the Aeron directory name to use when the persistent subscription creates its own Aeron client. Has no effect if an Aeron client is set via aeron_archive_persistent_subscription_context_set_aeron.

The directory name is copied into the context. The caller retains ownership of the supplied string.

§Parameters
  • aeron_directory_name the Aeron directory name.
§Return

0 on success, -1 on error.

Source

pub fn set_archive_context( &self, archive_context: &AeronArchiveContext, ) -> Result<i32, AeronCError>

Set the Aeron Archive client context that will be used by the persistent subscription.

§Parameters
  • archive_context the Aeron Archive client context to use.
§Return

0 on success, -1 on error.

Source

pub fn set_recording_id(&self, recording_id: i64) -> Result<i32, AeronCError>

Set the id of the live stream recording that will be used by the persistent subscription to catch up.

§Parameters
  • recording_id the recording id to use.
§Return

0 on success, -1 on error.

Source

pub fn get_recording_id(&self) -> i64

Get the id of the live stream recording that will be used by the persistent subscription to catch up.

§Return

the recording id. @see aeron_archive_persistent_subscription_context_set_recording_id

Source

pub fn set_live_channel(&self, live_channel: &CStr) -> Result<i32, AeronCError>

Set the live channel.

§Parameters
  • live_channel the live channel which will be copied.
§Return

0 on success, -1 on error.

Source

pub fn get_live_channel(&self) -> &str

Get the live channel.

§Return

the live channel. @see aeron_archive_persistent_subscription_context_set_live_channel

Source

pub fn set_live_stream_id( &self, live_stream_id: i32, ) -> Result<i32, AeronCError>

Set the id of the live stream.

§Parameters
  • live_stream_id the live stream id.
§Return

0 on success, -1 on error.

Source

pub fn get_live_stream_id(&self) -> i32

Get the id of the live stream.

§Return

the live stream id. @see aeron_archive_persistent_subscription_context_set_live_stream_id

Source

pub fn set_replay_channel( &self, replay_channel: &CStr, ) -> Result<i32, AeronCError>

Set the channel used for replays.

§Parameters
  • replay_channel the channel to use for replays which will be copied.
§Return

0 on success, -1 on error.

Source

pub fn get_replay_channel(&self) -> &str

Get the channel used for replays.

§Return

the replay channel. @see aeron_archive_persistent_subscription_context_set_replay_channel

Source

pub fn set_replay_stream_id( &self, replay_stream_id: i32, ) -> Result<i32, AeronCError>

Set the id of the stream used for replays.

§Parameters
  • replay_stream_id the stream id to use for replays.
§Return

0 on success, -1 on error.

Source

pub fn get_replay_stream_id(&self) -> i32

Get the id of the stream used for replays.

§Return

the replay stream id. @see aeron_archive_persistent_subscription_context_set_replay_stream_id

Source

pub fn set_start_position( &self, start_position: i64, ) -> Result<i32, AeronCError>

Set the position to start the subscription from, can be an actual position or AERON_ARCHIVE_PERSISTENT_SUBSCRIPTION_FROM_START or AERON_ARCHIVE_PERSISTENT_SUBSCRIPTION_FROM_LIVE.

§Parameters
  • start_position the position to start the subscription from.
§Return

0 on success, -1 on error.

Source

pub fn get_start_position(&self) -> i64

Get the position to start the subscription from.

§Return

the start position. @see aeron_archive_persistent_subscription_context_set_start_position

Source

pub fn set_listener( &self, listener: *const aeron_archive_persistent_subscription_listener_t, ) -> Result<i32, AeronCError>

Set the listener for events from the persistent subscription.

§Parameters
  • listener the listener to set. The content of the listener struct is copied by value.
§Return

0 on success, -1 on error.

Source

pub fn set_state_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>

Set the counter for tracking the current state of the persistent subscription.

§Parameters
  • counter the state counter.
§Return

0 on success, -1 on error.

Source

pub fn get_state_counter(&self) -> AeronCounter

Get the counter for tracking the current state of the persistent subscription.

§Return

the state counter. @see aeron_archive_persistent_subscription_context_set_state_counter

Source

pub fn set_join_difference_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>

Set the counter for tracking the join difference of the persistent subscription. The join difference is the difference between the live position and the replay position when transitioning. When not live, the value is INT64_MIN.

§Parameters
  • counter the join difference counter.
§Return

0 on success, -1 on error.

Source

pub fn get_join_difference_counter(&self) -> AeronCounter

Get the counter for tracking the join difference of the persistent subscription.

§Return

the join difference counter. @see aeron_archive_persistent_subscription_context_set_join_difference_counter

Source

pub fn set_live_left_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>

Set the counter for tracking the number of times the live stream has been left.

§Parameters
  • counter the live left counter.
§Return

0 on success, -1 on error.

Source

pub fn get_live_left_counter(&self) -> AeronCounter

Get the counter for tracking the number of times the live stream has been left.

§Return

the live left counter. @see aeron_archive_persistent_subscription_context_set_live_left_counter

Source

pub fn set_live_joined_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>

Set the counter for tracking the number of times live has been joined.

§Parameters
  • counter the live joined counter.
§Return

0 on success, -1 on error.

Source

pub fn get_live_joined_counter(&self) -> AeronCounter

Get the counter for tracking the number of times live has been joined.

§Return

the live joined counter. @see aeron_archive_persistent_subscription_context_set_live_joined_counter

Source

pub fn get_inner(&self) -> *mut aeron_archive_persistent_subscription_context_t

Source

pub unsafe fn get_inner_mut( &self, ) -> &mut aeron_archive_persistent_subscription_context_t

Mutable access to the underlying C struct, minted from &self: nothing prevents two live &mut at once, so the caller must ensure exclusive access for the lifetime of the returned reference.

§Safety

No other reference (& or &mut) to the underlying struct may be alive while the returned &mut is in use.

Source

pub fn get_inner_ref(&self) -> &aeron_archive_persistent_subscription_context_t

Trait Implementations§

Source§

impl Clone for AeronArchivePersistentSubscriptionContext

Source§

fn clone(&self) -> AeronArchivePersistentSubscriptionContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AeronArchivePersistentSubscriptionContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for AeronArchivePersistentSubscriptionContext

Source§

type Target = aeron_archive_persistent_subscription_context_stct

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<&AeronArchivePersistentSubscriptionContext> for *mut aeron_archive_persistent_subscription_context_t

Source§

fn from(value: &AeronArchivePersistentSubscriptionContext) -> Self

Converts to this type from the input type.
Source§

impl From<*const aeron_archive_persistent_subscription_context_stct> for AeronArchivePersistentSubscriptionContext

Source§

fn from(value: *const aeron_archive_persistent_subscription_context_t) -> Self

Converts to this type from the input type.
Source§

impl From<*mut aeron_archive_persistent_subscription_context_stct> for AeronArchivePersistentSubscriptionContext

Source§

fn from(value: *mut aeron_archive_persistent_subscription_context_t) -> Self

Converts to this type from the input type.
Source§

impl From<AeronArchivePersistentSubscriptionContext> for *mut aeron_archive_persistent_subscription_context_t

Source§

fn from(value: AeronArchivePersistentSubscriptionContext) -> Self

Converts to this type from the input type.
Source§

impl From<AeronArchivePersistentSubscriptionContext> for aeron_archive_persistent_subscription_context_t

Source§

fn from(value: AeronArchivePersistentSubscriptionContext) -> Self

Converts to this type from the input type.
Source§

impl From<aeron_archive_persistent_subscription_context_stct> for AeronArchivePersistentSubscriptionContext

Source§

fn from(value: aeron_archive_persistent_subscription_context_t) -> Self

Converts to this type from the input type.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.