pub struct AeronArchiveReplayMerge { /* private fields */ }Implementations§
Source§impl AeronArchiveReplayMerge
impl AeronArchiveReplayMerge
Sourcepub fn new(
subscription: &AeronSubscription,
aeron_archive: &AeronArchive,
replay_channel: &CStr,
replay_destination: &CStr,
live_destination: &CStr,
recording_id: i64,
start_position: i64,
epoch_clock: c_longlong,
merge_progress_timeout_ms: i64,
) -> Result<Self, AeronCError>
pub fn new( subscription: &AeronSubscription, aeron_archive: &AeronArchive, replay_channel: &CStr, replay_destination: &CStr, live_destination: &CStr, recording_id: i64, start_position: i64, epoch_clock: c_longlong, merge_progress_timeout_ms: i64, ) -> Result<Self, AeronCError>
Create an AeronArchiveReplayMerge to manage the merging of a replayed stream into a live stream.
§Parameters
-
replay_mergetheAeronArchiveReplayMergeto create and initialize -
subscriptionthe subscription to use for the replay and live stream. Must be a multi-destination subscription -
aeron_archivethe archive client -
replay_channelthe channel to use for the replay -
replay_destinationthe replay channel to use for the destination added by the subscription -
live_destinationthe live stream channel to use for the destination added by the subscription -
recording_idthe recording id of the archive to replay -
start_positionthe start position of the replay -
epoch_clockthe clock to use for progress checks -
merge_progress_timeout_msthe timeout to use for progress checks
§Return
0 for success, -1 for failure
Sourcepub fn do_work(&self) -> Result<c_int, AeronCError>
pub fn do_work(&self) -> Result<c_int, AeronCError>
Process the operation of the merge. Do not call the processing of fragments on the subscription.
§Parameters
work_count_pan indicator of work done
Sourcepub fn poll<AeronFragmentHandlerHandlerImpl: AeronFragmentHandlerCallback>(
&self,
handler: Option<&Handler<AeronFragmentHandlerHandlerImpl>>,
fragment_limit: c_int,
) -> Result<i32, AeronCError>
pub fn poll<AeronFragmentHandlerHandlerImpl: AeronFragmentHandlerCallback>( &self, handler: Option<&Handler<AeronFragmentHandlerHandlerImpl>>, fragment_limit: c_int, ) -> Result<i32, AeronCError>
Poll the image used for the merging replay and live stream. The aeron_archive_replay_merge_do_work will be called before the poll so that processing of the merge can be done.
§Parameters
-
handlerthe handler to call for incoming fragments -
clientdthe clientd to provide to the handler -
fragment_limitthe max number of fragments to process before returning
§Return
= 0 indicates the number of fragments processed, -1 for failure
Sourcepub fn poll_fn<AeronFragmentHandlerHandlerImpl: FnMut(&[u8], AeronHeader)>(
&self,
handler: AeronFragmentHandlerHandlerImpl,
fragment_limit: c_int,
) -> Result<i32, AeronCError>
pub fn poll_fn<AeronFragmentHandlerHandlerImpl: FnMut(&[u8], AeronHeader)>( &self, handler: AeronFragmentHandlerHandlerImpl, fragment_limit: c_int, ) -> Result<i32, AeronCError>
Poll the image used for the merging replay and live stream. The aeron_archive_replay_merge_do_work will be called before the poll so that processing of the merge can be done.
§Parameters
-
handlerthe handler to call for incoming fragments -
clientdthe clientd to provide to the handler -
fragment_limitthe max number of fragments to process before returning
§Return
= 0 indicates the number of fragments processed, -1 for failure
Stack-borrowed closure (_fn variant): the FnMut closure lives on the
caller’s stack and is borrowed for this call only — the callback fires
synchronously inside the call, so nothing is heap-allocated, nothing is stored,
and the closure may borrow local state. Prefer this over the retained
Handler-based form on the hot path; only generated for callbacks the C
client does not retain (i.e. not stored for later firing).
§Panics
A panic inside the closure cannot unwind across the extern "C" callback
boundary and aborts the process (since Rust 1.81). Return early instead
of panicking in production fragment handlers.
Sourcepub fn image(&self) -> AeronImage
pub fn image(&self) -> AeronImage
Sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Sourcepub fn is_live_added(&self) -> bool
pub fn is_live_added(&self) -> bool
Is the live destination added to the subscription?
§Return
true if the live destination is added to the subscription
pub fn get_inner(&self) -> *mut aeron_archive_replay_merge_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_archive_replay_merge_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_archive_replay_merge_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_replay_merge_t
Trait Implementations§
Source§impl Clone for AeronArchiveReplayMerge
impl Clone for AeronArchiveReplayMerge
Source§fn clone(&self) -> AeronArchiveReplayMerge
fn clone(&self) -> AeronArchiveReplayMerge
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more