pub struct Aeron { /* private fields */ }Implementations§
Source§impl Aeron
impl Aeron
pub fn async_add_counter( &self, type_id: i32, key_buffer: &[u8], label_buffer: &str, ) -> Result<AeronAsyncAddCounter, AeronCError>
Source§impl Aeron
impl Aeron
pub fn add_counter( &self, type_id: i32, key_buffer: &[u8], label_buffer: &str, timeout: Duration, ) -> Result<AeronCounter, AeronCError>
Source§impl Aeron
impl Aeron
pub fn async_add_exclusive_publication( &self, uri: &CStr, stream_id: i32, ) -> Result<AeronAsyncAddExclusivePublication, AeronCError>
Source§impl Aeron
impl Aeron
pub fn add_exclusive_publication( &self, uri: &CStr, stream_id: i32, timeout: Duration, ) -> Result<AeronExclusivePublication, AeronCError>
Source§impl Aeron
impl Aeron
pub fn async_add_publication( &self, uri: &CStr, stream_id: i32, ) -> Result<AeronAsyncAddPublication, AeronCError>
Source§impl Aeron
impl Aeron
pub fn add_publication( &self, uri: &CStr, stream_id: i32, timeout: Duration, ) -> Result<AeronPublication, AeronCError>
Source§impl Aeron
impl Aeron
pub fn async_add_subscription<AeronAvailableImageHandlerImpl: AeronAvailableImageCallback, AeronUnavailableImageHandlerImpl: AeronUnavailableImageCallback>( &self, uri: &CStr, stream_id: i32, on_available_image_handler: Option<&Handler<AeronAvailableImageHandlerImpl>>, on_unavailable_image_handler: Option<&Handler<AeronUnavailableImageHandlerImpl>>, ) -> Result<AeronAsyncAddSubscription, AeronCError>
Source§impl Aeron
impl Aeron
pub fn add_subscription<AeronAvailableImageHandlerImpl: AeronAvailableImageCallback, AeronUnavailableImageHandlerImpl: AeronUnavailableImageCallback>( &self, uri: &CStr, stream_id: i32, on_available_image_handler: Option<&Handler<AeronAvailableImageHandlerImpl>>, on_unavailable_image_handler: Option<&Handler<AeronUnavailableImageHandlerImpl>>, timeout: Duration, ) -> Result<AeronSubscription, AeronCError>
Source§impl Aeron
impl Aeron
Sourcepub fn new(context: &AeronContext) -> Result<Self, AeronCError>
pub fn new(context: &AeronContext) -> Result<Self, AeronCError>
Sourcepub fn start(&self) -> Result<i32, AeronCError>
pub fn start(&self) -> Result<i32, AeronCError>
Start an Aeron. This may spawn a thread for the Client Conductor.
§Return
0 for success and -1 for error.
Sourcepub fn main_do_work(&self) -> Result<i32, AeronCError>
pub fn main_do_work(&self) -> Result<i32, AeronCError>
Call the Conductor main do_work duty cycle once.
Client must have been created with use conductor invoker set to true.
§Return
0 for success and -1 for error.
Sourcepub fn main_idle_strategy(&self, work_count: c_int)
pub fn main_idle_strategy(&self, work_count: c_int)
Sourcepub fn close(&self) -> Result<i32, AeronCError>
pub fn close(&self) -> Result<i32, AeronCError>
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Determines if the client has been closed, e.g. via a driver timeout. Don’t call this method after calling aeron_close as that will have already freed the associated memory.
§Return
true if it has been closed, false otherwise.
Sourcepub fn print_counters(
&self,
stream_out: Option<unsafe extern "C" fn(arg1: *const c_char)>,
)
pub fn print_counters( &self, stream_out: Option<unsafe extern "C" fn(arg1: *const c_char)>, )
Call stream_out to print the counter labels and values.
§Parameters
stream_outto call for each label and value.
Sourcepub fn context(&self) -> AeronContext
pub fn context(&self) -> AeronContext
Return the AeronContext that is in use by the given client.
§Return
the AeronContext for the given client or NULL for an error.
Sourcepub fn next_correlation_id(&self) -> i64
pub fn next_correlation_id(&self) -> i64
Sourcepub fn async_add_publication_cancel(
&self,
async_: &AeronAsyncAddPublication,
) -> Result<i32, AeronCError>
pub fn async_add_publication_cancel( &self, async_: &AeronAsyncAddPublication, ) -> Result<i32, AeronCError>
Cancel an in-progress aeron_async_add_publication operation.
Will eventually free the given instance. If a publication gets created by
the time cancellation happens, it will get removed.AeronAsyncAddPublication
Note: The above guarantees only apply when a call to this method succeeds, i.e. return value is zero. If a
return value is non-zero the operation won’t be canceled and the instance
won’t be freed.AeronAsyncAddPublication
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_publication<AeronNotificationHandlerImpl: AeronNotificationCallback>(
&self,
registration_id: i64,
on_complete: Option<&Handler<AeronNotificationHandlerImpl>>,
) -> Result<i32, AeronCError>
pub fn async_remove_publication<AeronNotificationHandlerImpl: AeronNotificationCallback>( &self, registration_id: i64, on_complete: Option<&Handler<AeronNotificationHandlerImpl>>, ) -> Result<i32, AeronCError>
Asynchronously remove a publication.
If there is an AeronPublication object for that publication, it will get closed and freed.
§Parameters
-
registration_idof the publication to be removed. -
on_completeoptional callback to execute once the publication has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_publication_once<AeronNotificationHandlerImpl: FnMut()>(
&self,
registration_id: i64,
on_complete: AeronNotificationHandlerImpl,
) -> Result<i32, AeronCError>
pub fn async_remove_publication_once<AeronNotificationHandlerImpl: FnMut()>( &self, registration_id: i64, on_complete: AeronNotificationHandlerImpl, ) -> Result<i32, AeronCError>
Asynchronously remove a publication.
If there is an AeronPublication object for that publication, it will get closed and freed.
§Parameters
-
registration_idof the publication to be removed. -
on_completeoptional callback to execute once the publication has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
NOTE: aeron must not store this closure and instead use it immediately. If not you will get undefined behaviour, use with care
Sourcepub fn async_add_exclusive_publication_cancel(
&self,
async_: &AeronAsyncAddExclusivePublication,
) -> Result<i32, AeronCError>
pub fn async_add_exclusive_publication_cancel( &self, async_: &AeronAsyncAddExclusivePublication, ) -> Result<i32, AeronCError>
Cancel an in-progress aeron_async_add_exclusive_publication operation.
Will eventually free the given instance. If a publication gets
created by the time cancellation happens, it will get removed.AeronAsyncAddExclusivePublication
Note: The above guarantees only apply when a call to this method succeeds, i.e. return value is zero. If a
return value is non-zero the operation won’t be canceled and the
instance won’t be freed.AeronAsyncAddExclusivePublication
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_exclusive_publication<AeronNotificationHandlerImpl: AeronNotificationCallback>(
&self,
registration_id: i64,
on_complete: Option<&Handler<AeronNotificationHandlerImpl>>,
) -> Result<i32, AeronCError>
pub fn async_remove_exclusive_publication<AeronNotificationHandlerImpl: AeronNotificationCallback>( &self, registration_id: i64, on_complete: Option<&Handler<AeronNotificationHandlerImpl>>, ) -> Result<i32, AeronCError>
Asynchronously remove an exclusive publication.
If there is an AeronExclusivePublication object for that publication, it will get closed and freed.
§Parameters
-
registration_idof the exclusive publication to be removed. -
on_completeoptional callback to execute once the exclusive publication has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_exclusive_publication_once<AeronNotificationHandlerImpl: FnMut()>(
&self,
registration_id: i64,
on_complete: AeronNotificationHandlerImpl,
) -> Result<i32, AeronCError>
pub fn async_remove_exclusive_publication_once<AeronNotificationHandlerImpl: FnMut()>( &self, registration_id: i64, on_complete: AeronNotificationHandlerImpl, ) -> Result<i32, AeronCError>
Asynchronously remove an exclusive publication.
If there is an AeronExclusivePublication object for that publication, it will get closed and freed.
§Parameters
-
registration_idof the exclusive publication to be removed. -
on_completeoptional callback to execute once the exclusive publication has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
NOTE: aeron must not store this closure and instead use it immediately. If not you will get undefined behaviour, use with care
Sourcepub fn async_add_subscription_cancel(
&self,
async_: &AeronAsyncAddSubscription,
) -> Result<i32, AeronCError>
pub fn async_add_subscription_cancel( &self, async_: &AeronAsyncAddSubscription, ) -> Result<i32, AeronCError>
Cancel an in-progress aeron_async_add_subscription operation.
Will eventually free the given instance. If a subscription gets created
by the time cancellation happens, it will get removed.AeronAsyncAddSubscription
Note: The above guarantees only apply when a call to this method succeeds, i.e. return value is zero. If a
return value is non-zero the operation won’t be canceled and the instance
won’t be freed.AeronAsyncAddSubscription
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_subscription<AeronNotificationHandlerImpl: AeronNotificationCallback>(
&self,
registration_id: i64,
on_complete: Option<&Handler<AeronNotificationHandlerImpl>>,
) -> Result<i32, AeronCError>
pub fn async_remove_subscription<AeronNotificationHandlerImpl: AeronNotificationCallback>( &self, registration_id: i64, on_complete: Option<&Handler<AeronNotificationHandlerImpl>>, ) -> Result<i32, AeronCError>
Asynchronously remove a subscription.
If there is an AeronSubscription object for that subscription, it will get closed and freed.
§Parameters
-
registration_idof the subscription to be removed. -
on_completeoptional callback to execute once the subscription has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_subscription_once<AeronNotificationHandlerImpl: FnMut()>(
&self,
registration_id: i64,
on_complete: AeronNotificationHandlerImpl,
) -> Result<i32, AeronCError>
pub fn async_remove_subscription_once<AeronNotificationHandlerImpl: FnMut()>( &self, registration_id: i64, on_complete: AeronNotificationHandlerImpl, ) -> Result<i32, AeronCError>
Asynchronously remove a subscription.
If there is an AeronSubscription object for that subscription, it will get closed and freed.
§Parameters
-
registration_idof the subscription to be removed. -
on_completeoptional callback to execute once the subscription has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
NOTE: aeron must not store this closure and instead use it immediately. If not you will get undefined behaviour, use with care
Sourcepub fn counters_reader(&self) -> AeronCountersReader
pub fn counters_reader(&self) -> AeronCountersReader
Return a reference to the counters reader of the given client.
The AeronCountersReader is maintained by the client. And should not be freed.
§Return
AeronCountersReader or NULL for error.
Sourcepub fn async_add_counter_cancel(
&self,
async_: &AeronAsyncAddCounter,
) -> Result<i32, AeronCError>
pub fn async_add_counter_cancel( &self, async_: &AeronAsyncAddCounter, ) -> Result<i32, AeronCError>
Cancel an in-progress aeron_async_add_counter operation. Not applicable to
aeron_async_add_static_counter, i.e. attempt to cancel static counter will fail with an error.
Will eventually free the given instance. If a counter gets created by the time
cancellation happens, it will get removed.AeronAsyncAddCounter
Note: The above guarantees only apply when a call to this method succeeds, i.e. return value is zero. If a
return value is non-zero the operation won’t be canceled and the instance
won’t be freed.AeronAsyncAddCounter
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_counter<AeronNotificationHandlerImpl: AeronNotificationCallback>(
&self,
registration_id: i64,
on_complete: Option<&Handler<AeronNotificationHandlerImpl>>,
) -> Result<i32, AeronCError>
pub fn async_remove_counter<AeronNotificationHandlerImpl: AeronNotificationCallback>( &self, registration_id: i64, on_complete: Option<&Handler<AeronNotificationHandlerImpl>>, ) -> Result<i32, AeronCError>
Asynchronously remove a counter. Not applicable to static counters.
If there is an AeronCounter object for that counter, it will get closed and freed.
§Parameters
-
registration_idof the counter to be removed. -
on_completeoptional callback to execute once the counter has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
Sourcepub fn async_remove_counter_once<AeronNotificationHandlerImpl: FnMut()>(
&self,
registration_id: i64,
on_complete: AeronNotificationHandlerImpl,
) -> Result<i32, AeronCError>
pub fn async_remove_counter_once<AeronNotificationHandlerImpl: FnMut()>( &self, registration_id: i64, on_complete: AeronNotificationHandlerImpl, ) -> Result<i32, AeronCError>
Asynchronously remove a counter. Not applicable to static counters.
If there is an AeronCounter object for that counter, it will get closed and freed.
§Parameters
-
registration_idof the counter to be removed. -
on_completeoptional callback to execute once the counter has been removed. This may happen on a separate thread, so the caller should ensure that clientd has the appropriate lifetime. Use NULL if not needed. -
on_complete_clientdparameter to pass to the on_complete callback.
§Return
0 for success or -1 for error.
NOTE: aeron must not store this closure and instead use it immediately. If not you will get undefined behaviour, use with care
Sourcepub fn add_available_counter_handler(
&self,
pair: &AeronAvailableCounterPair,
) -> Result<i32, AeronCError>
pub fn add_available_counter_handler( &self, pair: &AeronAvailableCounterPair, ) -> Result<i32, AeronCError>
Sourcepub fn remove_available_counter_handler(
&self,
pair: &AeronAvailableCounterPair,
) -> Result<i32, AeronCError>
pub fn remove_available_counter_handler( &self, pair: &AeronAvailableCounterPair, ) -> Result<i32, AeronCError>
Remove a previously added handler to be called when a new counter becomes unavailable or goes away.
NOTE: This function blocks until the handler is removed by the client conductor thread.
§Parameters
pairholding the handler to call and a clientd to pass when called.
§Return
0 for success and -1 for error
Sourcepub fn add_close_handler(
&self,
pair: &AeronCloseClientPair,
) -> Result<i32, AeronCError>
pub fn add_close_handler( &self, pair: &AeronCloseClientPair, ) -> Result<i32, AeronCError>
Sourcepub fn remove_close_handler(
&self,
pair: &AeronCloseClientPair,
) -> Result<i32, AeronCError>
pub fn remove_close_handler( &self, pair: &AeronCloseClientPair, ) -> Result<i32, AeronCError>
Sourcepub fn version_full() -> &'static str
pub fn version_full() -> &'static str
Return full version and build string.
§Return
full version and build string. SAFETY: this is static for performance reasons, so you should not store this without copying it!!
Sourcepub fn version_text() -> &'static str
pub fn version_text() -> &'static str
Return version text.
§Return
version text. SAFETY: this is static for performance reasons, so you should not store this without copying it!!
Sourcepub fn version_major() -> Result<i32, AeronCError>
pub fn version_major() -> Result<i32, AeronCError>
Sourcepub fn version_minor() -> Result<i32, AeronCError>
pub fn version_minor() -> Result<i32, AeronCError>
Sourcepub fn version_patch() -> Result<i32, AeronCError>
pub fn version_patch() -> Result<i32, AeronCError>
Sourcepub fn version_gitsha() -> &'static str
pub fn version_gitsha() -> &'static str
Return the git sha for the current build.
§Return
git version SAFETY: this is static for performance reasons, so you should not store this without copying it!!
Sourcepub fn nano_clock() -> i64
pub fn nano_clock() -> i64
Return time in nanoseconds for machine. Is not wall clock time.
§Return
nanoseconds since epoch for machine.
Sourcepub fn epoch_clock() -> i64
pub fn epoch_clock() -> i64
Sourcepub fn is_driver_active(
dirname: &CStr,
timeout_ms: i64,
log_func: aeron_log_func_t,
) -> bool
pub fn is_driver_active( dirname: &CStr, timeout_ms: i64, log_func: aeron_log_func_t, ) -> bool
Sourcepub fn properties_buffer_load(buffer: &CStr) -> Result<i32, AeronCError>
pub fn properties_buffer_load(buffer: &CStr) -> Result<i32, AeronCError>
Sourcepub fn properties_file_load(filename: &CStr) -> Result<i32, AeronCError>
pub fn properties_file_load(filename: &CStr) -> Result<i32, AeronCError>
Sourcepub fn properties_http_load(url: &CStr) -> Result<i32, AeronCError>
pub fn properties_http_load(url: &CStr) -> Result<i32, AeronCError>
Sourcepub fn properties_load(url_or_filename: &CStr) -> Result<i32, AeronCError>
pub fn properties_load(url_or_filename: &CStr) -> Result<i32, AeronCError>
Load properties based on URL or filename. If string contains file or http URL, it will attempt to load properties from a file or http as indicated. If not a URL, then it will try to load the string as a filename.
§Parameters
url_or_filenameto load properties from.
§Return
0 for success and -1 for error.
Sourcepub fn errcode() -> Result<i32, AeronCError>
pub fn errcode() -> Result<i32, AeronCError>
Return current aeron error code (errno) for calling thread.
§Return
aeron error code for calling thread.
Sourcepub fn errmsg() -> &'static str
pub fn errmsg() -> &'static str
Return the current aeron error message for calling thread.
§Return
aeron error message for calling thread. SAFETY: this is static for performance reasons, so you should not store this without copying it!!
Sourcepub fn default_path(
path: *mut c_char,
path_length: usize,
) -> Result<i32, AeronCError>
pub fn default_path( path: *mut c_char, path_length: usize, ) -> Result<i32, AeronCError>
Get the default path used by the Aeron media driver.
§Parameters
-
pathbuffer to store the path. -
path_lengthspace available in the buffer
§Return
-1 if there is an issue or the number of bytes written to path excluding the terminator \0. If this
is equal to or greater than the path_length then the path has been truncated.