pub struct AeronArchiveContext { /* private fields */ }Implementations§
Source§impl AeronArchiveContext
impl AeronArchiveContext
Sourcepub fn aeron_archive_async_connect(
&self,
) -> Result<AeronArchiveAsyncConnect, AeronCError>
pub fn aeron_archive_async_connect( &self, ) -> Result<AeronArchiveAsyncConnect, AeronCError>
§Handler lifetime and async close
If this call takes a Handler, the conductor may invoke its callbacks
after the resource’s close() or drop returns. The C close is asynchronous.
The new resource keeps a clone of its Aeron client. The client keeps
registered handlers alive until its last owning reference drops and C cleanup
finishes. Closing the resource earlier does not free its handlers.
You do not need to call release().
Each registration adds a handler clone to the client. The closures and any values they capture stay in memory until client cleanup, even after the conductor finishes closing the resource.
Source§impl AeronArchiveContext
impl AeronArchiveContext
Sourcepub fn aeron_archive_connect(
&self,
timeout: Duration,
) -> Result<AeronArchive, AeronCError>
pub fn aeron_archive_connect( &self, timeout: Duration, ) -> Result<AeronArchive, AeronCError>
Blocking convenience wrapper around the async add operation.
For examples and tests. Blocks the calling thread in a busy-poll loop until
the resource is available or timeout elapses. In production, call the
async_add_* variant and drive its poll() from your event loop.
§Event loop example
// Don't block. Drive the async poller from your loop
let poller = client.async_add_*(...)?;
loop {
if let Some(resource) = poller.poll()? {
break; // ready
}
do_other_work(); // service other subscriptions, timers, etc.
}poll_blocking on the async poller also blocks the calling thread.
Source§impl AeronArchiveContext
impl AeronArchiveContext
Sourcepub fn new() -> Result<Self, AeronCError>
pub fn new() -> Result<Self, AeronCError>
Create an AeronArchiveContext struct.
pub fn aeron(&self) -> Ref<'_, Aeron>
pub fn aeron_directory_name(&self) -> [c_char; 4096]
pub fn client_name(&self) -> [c_char; 101]
pub fn owns_aeron_client(&self) -> bool
pub fn control_request_channel(&self) -> &str
pub fn control_request_channel_length(&self) -> usize
pub fn control_request_stream_id(&self) -> i32
pub fn control_response_channel(&self) -> &str
pub fn control_response_channel_length(&self) -> usize
pub fn control_response_stream_id(&self) -> i32
pub fn recording_events_channel(&self) -> &str
pub fn recording_events_channel_length(&self) -> usize
pub fn recording_events_stream_id(&self) -> i32
pub fn message_timeout_ns(&self) -> u64
pub fn message_retry_attempts(&self) -> u32
pub fn control_term_buffer_length(&self) -> usize
pub fn control_mtu_length(&self) -> usize
pub fn control_term_buffer_sparse(&self) -> bool
pub fn idle_strategy_func(&self) -> aeron_idle_strategy_func_t
pub fn idle_strategy_state(&self) -> *mut c_void
pub fn owns_idle_strategy(&self) -> bool
pub fn credentials_supplier(&self) -> AeronArchiveCredentialsSupplier
pub fn on_recording_signal( &self, ) -> aeron_archive_recording_signal_consumer_func_t
pub fn on_recording_signal_clientd(&self) -> *mut c_void
pub fn error_handler(&self) -> aeron_error_handler_t
pub fn error_handler_clientd(&self) -> *mut c_void
pub fn delegating_invoker_func(&self) -> aeron_archive_delegating_invoker_func_t
pub fn delegating_invoker_func_clientd(&self) -> *mut c_void
Sourcepub fn set_aeron(&self, aeron: &Aeron) -> Result<i32, AeronCError>
pub fn set_aeron(&self, aeron: &Aeron) -> Result<i32, AeronCError>
Specify the client used for communicating with the local Media Driver.
This client will be closed with the AeronArchive is closed if aeron_archive_context_set_owns_aeron_client is true.
pub fn get_aeron(&self) -> Ref<'_, Aeron>
Sourcepub fn set_owns_aeron_client(
&self,
owns_aeron_client: bool,
) -> Result<i32, AeronCError>
pub fn set_owns_aeron_client( &self, owns_aeron_client: bool, ) -> Result<i32, AeronCError>
Specify whether or not this context owns the client and, therefore, takes responsibility for closing it.
pub fn get_owns_aeron_client(&self) -> bool
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>
Specify the top level Aeron directory used for communication between the Aeron client and the Media Driver.
pub fn get_aeron_directory_name(&self) -> &str
Sourcepub fn set_control_request_channel(
&self,
control_request_channel: &CStr,
) -> Result<i32, AeronCError>
pub fn set_control_request_channel( &self, control_request_channel: &CStr, ) -> Result<i32, AeronCError>
Specify the channel used for sending requests to the Aeron Archive.
pub fn get_control_request_channel(&self) -> &str
Sourcepub fn set_control_request_stream_id(
&self,
control_request_stream_id: i32,
) -> Result<i32, AeronCError>
pub fn set_control_request_stream_id( &self, control_request_stream_id: i32, ) -> Result<i32, AeronCError>
Specify the stream used for sending requests to the Aeron Archive.
pub fn get_control_request_stream_id(&self) -> i32
Sourcepub fn set_control_response_channel(
&self,
control_response_channel: &CStr,
) -> Result<i32, AeronCError>
pub fn set_control_response_channel( &self, control_response_channel: &CStr, ) -> Result<i32, AeronCError>
Specify the channel used for receiving responses from the Aeron Archive.
pub fn get_control_response_channel(&self) -> &str
Sourcepub fn set_control_response_stream_id(
&self,
control_response_stream_id: i32,
) -> Result<i32, AeronCError>
pub fn set_control_response_stream_id( &self, control_response_stream_id: i32, ) -> Result<i32, AeronCError>
Specify the stream used for receiving responses from the Aeron Archive.
pub fn get_control_response_stream_id(&self) -> i32
Sourcepub fn set_recording_events_channel(
&self,
recording_events_channel: &CStr,
) -> Result<i32, AeronCError>
pub fn set_recording_events_channel( &self, recording_events_channel: &CStr, ) -> Result<i32, AeronCError>
Specify the channel used for receiving recording events from the Aeron Archive.
pub fn get_recording_events_channel(&self) -> &str
Sourcepub fn set_recording_events_stream_id(
&self,
recording_events_stream_id: i32,
) -> Result<i32, AeronCError>
pub fn set_recording_events_stream_id( &self, recording_events_stream_id: i32, ) -> Result<i32, AeronCError>
Specify the stream id used for recording events channel.
pub fn get_recording_events_stream_id(&self) -> i32
Sourcepub fn set_message_timeout_ns(
&self,
message_timeout_ns: u64,
) -> Result<i32, AeronCError>
pub fn set_message_timeout_ns( &self, message_timeout_ns: u64, ) -> Result<i32, AeronCError>
Specify the message timeout, in nanoseconds, to wait for sending or receiving a message.
pub fn get_message_timeout_ns(&self) -> u64
Sourcepub fn set_message_retry_attempts(
&self,
message_retry_attempts: u32,
) -> Result<i32, AeronCError>
pub fn set_message_retry_attempts( &self, message_retry_attempts: u32, ) -> Result<i32, AeronCError>
Specify the number of retry attempts when offering messages to the archive.
pub fn get_message_retry_attempts(&self) -> u32
Sourcepub fn set_control_term_buffer_length(
&self,
control_term_buffer_length: usize,
) -> Result<i32, AeronCError>
pub fn set_control_term_buffer_length( &self, control_term_buffer_length: usize, ) -> Result<i32, AeronCError>
Specify the default term buffer length for the control request/response channels.
pub fn get_control_term_buffer_length(&self) -> usize
Sourcepub fn set_control_mtu_length(
&self,
control_mtu_length: usize,
) -> Result<i32, AeronCError>
pub fn set_control_mtu_length( &self, control_mtu_length: usize, ) -> Result<i32, AeronCError>
Specify the default MTU length for the control request/response channels.
pub fn get_control_mtu_length(&self) -> usize
Sourcepub fn set_control_term_buffer_sparse(
&self,
control_term_buffer_sparse: bool,
) -> Result<i32, AeronCError>
pub fn set_control_term_buffer_sparse( &self, control_term_buffer_sparse: bool, ) -> Result<i32, AeronCError>
Specify the default MTU length for the control request/response channels.
pub fn get_control_term_buffer_sparse(&self) -> bool
Sourcepub fn set_client_name(&self, value: &CStr) -> Result<i32, AeronCError>
pub fn set_client_name(&self, value: &CStr) -> Result<i32, AeronCError>
Specify client name to identify this client on the archive side.
pub fn get_client_name(&self) -> &str
Sourcepub fn set_idle_strategy<AeronIdleStrategyFuncHandlerImpl: AeronIdleStrategyFuncCallback + 'static>(
&self,
idle_strategy_func: Option<AeronIdleStrategyFuncHandlerImpl>,
) -> Result<Option<Handler<AeronIdleStrategyFuncHandlerImpl>>, AeronCError>
pub fn set_idle_strategy<AeronIdleStrategyFuncHandlerImpl: AeronIdleStrategyFuncCallback + 'static>( &self, idle_strategy_func: Option<AeronIdleStrategyFuncHandlerImpl>, ) -> Result<Option<Handler<AeronIdleStrategyFuncHandlerImpl>>, AeronCError>
Specify the idle strategy function and associated state used by the client between polling calls.
An owned wrapper keeps the callback alive until C cleanup finishes.
If the wrapper is borrowed, keep the returned Handler alive while C can call it.
Dropping the handler does not unregister the callback.
Returns the Handler so you can access its state. You can pass a closure with a matching signature.
Sourcepub fn set_credentials_supplier<AeronArchiveCredentialsFreeFuncHandlerImpl: AeronArchiveCredentialsFreeFuncCallback + 'static>(
&self,
encoded_credentials: aeron_archive_credentials_encoded_credentials_supplier_func_t,
on_challenge: aeron_archive_credentials_challenge_supplier_func_t,
on_free: Option<AeronArchiveCredentialsFreeFuncHandlerImpl>,
) -> Result<Option<Handler<AeronArchiveCredentialsFreeFuncHandlerImpl>>, AeronCError>
pub fn set_credentials_supplier<AeronArchiveCredentialsFreeFuncHandlerImpl: AeronArchiveCredentialsFreeFuncCallback + 'static>( &self, encoded_credentials: aeron_archive_credentials_encoded_credentials_supplier_func_t, on_challenge: aeron_archive_credentials_challenge_supplier_func_t, on_free: Option<AeronArchiveCredentialsFreeFuncHandlerImpl>, ) -> Result<Option<Handler<AeronArchiveCredentialsFreeFuncHandlerImpl>>, AeronCError>
Specify the various credentials callbacks to use when connecting to the Aeron Archive.
An owned wrapper keeps the callback alive until C cleanup finishes.
If the wrapper is borrowed, keep the returned Handler alive while C can call it.
Dropping the handler does not unregister the callback.
Returns the Handler so you can access its state. You can pass a closure with a matching signature.
Sourcepub fn set_recording_signal_consumer<AeronArchiveRecordingSignalConsumerFuncHandlerImpl: AeronArchiveRecordingSignalConsumerFuncCallback + 'static>(
&self,
on_recording_signal: Option<AeronArchiveRecordingSignalConsumerFuncHandlerImpl>,
) -> Result<Option<Handler<AeronArchiveRecordingSignalConsumerFuncHandlerImpl>>, AeronCError>
pub fn set_recording_signal_consumer<AeronArchiveRecordingSignalConsumerFuncHandlerImpl: AeronArchiveRecordingSignalConsumerFuncCallback + 'static>( &self, on_recording_signal: Option<AeronArchiveRecordingSignalConsumerFuncHandlerImpl>, ) -> Result<Option<Handler<AeronArchiveRecordingSignalConsumerFuncHandlerImpl>>, AeronCError>
Specify the callback to which recording signals are dispatched while polling for control responses.
An owned wrapper keeps the callback alive until C cleanup finishes.
If the wrapper is borrowed, keep the returned Handler alive while C can call it.
Dropping the handler does not unregister the callback.
Returns the Handler so you can access its state. You can pass a closure with a matching signature.
Sourcepub fn set_error_handler<AeronErrorHandlerHandlerImpl: AeronErrorHandlerCallback + 'static>(
&self,
error_handler: Option<AeronErrorHandlerHandlerImpl>,
) -> Result<Option<Handler<AeronErrorHandlerHandlerImpl>>, AeronCError>
pub fn set_error_handler<AeronErrorHandlerHandlerImpl: AeronErrorHandlerCallback + 'static>( &self, error_handler: Option<AeronErrorHandlerHandlerImpl>, ) -> Result<Option<Handler<AeronErrorHandlerHandlerImpl>>, AeronCError>
Specify the callback to which errors are dispatched while executing archive client commands.
An owned wrapper keeps the callback alive until C cleanup finishes.
If the wrapper is borrowed, keep the returned Handler alive while C can call it.
Dropping the handler does not unregister the callback.
Returns the Handler so you can access its state. You can pass a closure with a matching signature.
Sourcepub fn set_delegating_invoker<AeronArchiveDelegatingInvokerFuncHandlerImpl: AeronArchiveDelegatingInvokerFuncCallback + 'static>(
&self,
delegating_invoker_func: Option<AeronArchiveDelegatingInvokerFuncHandlerImpl>,
) -> Result<Option<Handler<AeronArchiveDelegatingInvokerFuncHandlerImpl>>, AeronCError>
pub fn set_delegating_invoker<AeronArchiveDelegatingInvokerFuncHandlerImpl: AeronArchiveDelegatingInvokerFuncCallback + 'static>( &self, delegating_invoker_func: Option<AeronArchiveDelegatingInvokerFuncHandlerImpl>, ) -> Result<Option<Handler<AeronArchiveDelegatingInvokerFuncHandlerImpl>>, AeronCError>
Specify the callback to be invoked in addition to any invoker used by the Aeron instance.
Useful when running in a low thread count environment.
An owned wrapper keeps the callback alive until C cleanup finishes.
If the wrapper is borrowed, keep the returned Handler alive while C can call it.
Dropping the handler does not unregister the callback.
Returns the Handler so you can access its state. You can pass a closure with a matching signature.
pub fn conclude(&self) -> Result<i32, AeronCError>
pub fn idle(&self)
pub fn invoke_aeron_client(&self) -> Result<i32, AeronCError>
pub fn invoke_error_handler( &self, correlation_id: i64, error_code: i32, error_message: &CStr, )
pub fn get_inner(&self) -> *mut aeron_archive_context_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_archive_context_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_archive_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_context_t
Source§impl AeronArchiveContext
impl AeronArchiveContext
Sourcepub fn set_message_timeout(&self, value: Duration) -> Result<i32, AeronCError>
pub fn set_message_timeout(&self, value: Duration) -> Result<i32, AeronCError>
Set the archive response timeout from a duration. Returns an error if its nanosecond value exceeds Aeron’s signed 64-bit clock range.
Sourcepub fn get_message_timeout(&self) -> Duration
pub fn get_message_timeout(&self) -> Duration
The archive response timeout as a std::time::Duration.
Trait Implementations§
Source§impl Clone for AeronArchiveContext
impl Clone for AeronArchiveContext
Source§fn clone(&self) -> AeronArchiveContext
fn clone(&self) -> AeronArchiveContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more