pub struct AeronArchivePersistentSubscriptionContext { /* private fields */ }Implementations§
Source§impl AeronArchivePersistentSubscriptionContext
impl AeronArchivePersistentSubscriptionContext
Sourcepub fn new() -> Result<Self, AeronCError>
pub fn new() -> Result<Self, AeronCError>
Sourcepub fn set_aeron(&self, aeron: &Aeron) -> Result<i32, AeronCError>
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
aeronthe Aeron client to use.
§Return
0 on success, -1 on error.
Sourcepub fn set_aeron_directory_name(
&self,
aeron_directory_name: &CStr,
) -> Result<i32, AeronCError>
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_namethe Aeron directory name.
§Return
0 on success, -1 on error.
Sourcepub fn set_archive_context(
&self,
archive_context: &AeronArchiveContext,
) -> Result<i32, AeronCError>
pub fn set_archive_context( &self, archive_context: &AeronArchiveContext, ) -> Result<i32, AeronCError>
Sourcepub fn set_recording_id(&self, recording_id: i64) -> Result<i32, AeronCError>
pub fn set_recording_id(&self, recording_id: i64) -> Result<i32, AeronCError>
Sourcepub fn get_recording_id(&self) -> i64
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
Sourcepub fn set_live_channel(&self, live_channel: &CStr) -> Result<i32, AeronCError>
pub fn set_live_channel(&self, live_channel: &CStr) -> Result<i32, AeronCError>
Sourcepub fn get_live_channel(&self) -> &str
pub fn get_live_channel(&self) -> &str
Get the live channel.
§Return
the live channel. @see aeron_archive_persistent_subscription_context_set_live_channel
Sourcepub fn set_live_stream_id(
&self,
live_stream_id: i32,
) -> Result<i32, AeronCError>
pub fn set_live_stream_id( &self, live_stream_id: i32, ) -> Result<i32, AeronCError>
Sourcepub fn get_live_stream_id(&self) -> i32
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
Sourcepub fn set_replay_channel(
&self,
replay_channel: &CStr,
) -> Result<i32, AeronCError>
pub fn set_replay_channel( &self, replay_channel: &CStr, ) -> Result<i32, AeronCError>
Sourcepub fn get_replay_channel(&self) -> &str
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
Sourcepub fn set_replay_stream_id(
&self,
replay_stream_id: i32,
) -> Result<i32, AeronCError>
pub fn set_replay_stream_id( &self, replay_stream_id: i32, ) -> Result<i32, AeronCError>
Sourcepub fn get_replay_stream_id(&self) -> i32
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
Sourcepub fn set_start_position(
&self,
start_position: i64,
) -> Result<i32, AeronCError>
pub fn set_start_position( &self, start_position: i64, ) -> Result<i32, AeronCError>
Sourcepub fn get_start_position(&self) -> i64
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
Sourcepub fn set_listener(
&self,
listener: *const aeron_archive_persistent_subscription_listener_t,
) -> Result<i32, AeronCError>
pub fn set_listener( &self, listener: *const aeron_archive_persistent_subscription_listener_t, ) -> Result<i32, AeronCError>
Sourcepub fn set_state_counter(
&self,
counter: &AeronCounter,
) -> Result<i32, AeronCError>
pub fn set_state_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>
Sourcepub fn get_state_counter(&self) -> AeronCounter
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
Sourcepub fn set_join_difference_counter(
&self,
counter: &AeronCounter,
) -> Result<i32, AeronCError>
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
counterthe join difference counter.
§Return
0 on success, -1 on error.
Sourcepub fn get_join_difference_counter(&self) -> AeronCounter
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
Sourcepub fn set_live_left_counter(
&self,
counter: &AeronCounter,
) -> Result<i32, AeronCError>
pub fn set_live_left_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>
Sourcepub fn get_live_left_counter(&self) -> AeronCounter
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
Sourcepub fn set_live_joined_counter(
&self,
counter: &AeronCounter,
) -> Result<i32, AeronCError>
pub fn set_live_joined_counter( &self, counter: &AeronCounter, ) -> Result<i32, AeronCError>
Sourcepub fn get_live_joined_counter(&self) -> AeronCounter
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
pub fn get_inner(&self) -> *mut aeron_archive_persistent_subscription_context_t
Sourcepub unsafe fn get_inner_mut(
&self,
) -> &mut aeron_archive_persistent_subscription_context_t
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.
pub fn get_inner_ref(&self) -> &aeron_archive_persistent_subscription_context_t
Trait Implementations§
Source§impl Clone for AeronArchivePersistentSubscriptionContext
impl Clone for AeronArchivePersistentSubscriptionContext
Source§fn clone(&self) -> AeronArchivePersistentSubscriptionContext
fn clone(&self) -> AeronArchivePersistentSubscriptionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more