pub struct AeronAsyncAddSubscription { /* private fields */ }Implementations§
Source§impl AeronAsyncAddSubscription
impl AeronAsyncAddSubscription
Sourcepub fn new_zeroed_on_heap() -> Self
pub fn new_zeroed_on_heap() -> Self
creates zeroed struct where the underlying c struct is on the heap
Sourcepub fn new_zeroed_on_stack() -> Self
pub fn new_zeroed_on_stack() -> Self
creates zeroed struct where the underlying c struct is on the stack (Use with care)
Sourcepub fn get_registration_id(&self) -> i64
pub fn get_registration_id(&self) -> i64
Gets the registration id for addition of the subscription. Note that using this after a call to poll the succeeds or errors is undefined behaviour. As the async_add_subscription_t may have been freed.
§Return
registration id for the subscription.
pub fn get_inner(&self) -> *mut aeron_async_add_subscription_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_async_add_subscription_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_async_add_subscription_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_async_add_subscription_t
Source§impl AeronAsyncAddSubscription
impl AeronAsyncAddSubscription
pub fn new<AeronAvailableImageHandlerImpl: AeronAvailableImageCallback + 'static, AeronUnavailableImageHandlerImpl: AeronUnavailableImageCallback + 'static>( client: &Aeron, uri: &CStr, stream_id: i32, on_available_image_handler: Option<&Handler<AeronAvailableImageHandlerImpl>>, on_unavailable_image_handler: Option<&Handler<AeronUnavailableImageHandlerImpl>>, ) -> Result<Self, AeronCError>
pub fn poll(&self) -> Result<Option<AeronSubscription>, AeronCError>
Sourcepub fn poll_blocking(
&self,
timeout: Duration,
) -> Result<AeronSubscription, AeronCError>
pub fn poll_blocking( &self, timeout: Duration, ) -> Result<AeronSubscription, AeronCError>
Polls synchronously until the async operation completes or timeout elapses.
Convenience for examples and tests only. It blocks the calling thread
in a busy-poll loop. In production, drive poll() from your own event loop
(between other work, on a timer, or in a dedicated duty cycle) rather than
blocking on a single operation.
§Production pattern (pseudo code)
// Don't block — integrate poll() into your existing loop
loop {
if let Some(resource) = poller.poll()? {
break; // ready
}
do_other_work(); // service other subscriptions, timers, etc.
}See the blocking add_*(.., timeout) helpers for the same caveat.
Trait Implementations§
Source§impl Clone for AeronAsyncAddSubscription
impl Clone for AeronAsyncAddSubscription
Source§fn clone(&self) -> AeronAsyncAddSubscription
fn clone(&self) -> AeronAsyncAddSubscription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more