pub struct AeronAsyncAddPublication { /* private fields */ }Implementations§
Source§impl AeronAsyncAddPublication
impl AeronAsyncAddPublication
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 publication. Note that using this after a call to poll the succeeds or errors is undefined behaviour. As the async_add_publication_t may have been freed.
§Return
registration id for the publication.
pub fn get_inner(&self) -> *mut aeron_async_add_publication_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_async_add_publication_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_async_add_publication_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_publication_t
Source§impl AeronAsyncAddPublication
impl AeronAsyncAddPublication
pub fn new( client: &Aeron, uri: &CStr, stream_id: i32, ) -> Result<Self, AeronCError>
pub fn poll(&self) -> Result<Option<AeronPublication>, AeronCError>
Sourcepub fn poll_blocking(
&self,
timeout: Duration,
) -> Result<AeronPublication, AeronCError>
pub fn poll_blocking( &self, timeout: Duration, ) -> Result<AeronPublication, 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 AeronAsyncAddPublication
impl Clone for AeronAsyncAddPublication
Source§fn clone(&self) -> AeronAsyncAddPublication
fn clone(&self) -> AeronAsyncAddPublication
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more