pub struct AeronAsyncAddExclusivePublication<S: ResourceStorage<aeron_async_add_exclusive_publication_t> = CResource<aeron_async_add_exclusive_publication_t>> { /* private fields */ }Implementations§
Source§impl AeronAsyncAddExclusivePublication<CResource<aeron_async_add_exclusive_publication_t>>
impl AeronAsyncAddExclusivePublication<CResource<aeron_async_add_exclusive_publication_t>>
Sourcepub unsafe fn new_zeroed_on_heap() -> Self
pub unsafe fn new_zeroed_on_heap() -> Self
Creates zeroed native storage on the heap.
§Safety
For handles with native methods, initialise the native state before calling those methods. Zeroed storage is not a connection.
Sourcepub unsafe fn new_zeroed_on_stack() -> AeronAsyncAddExclusivePublication<Inline<aeron_async_add_exclusive_publication_t>>
pub unsafe fn new_zeroed_on_stack() -> AeronAsyncAddExclusivePublication<Inline<aeron_async_add_exclusive_publication_t>>
Creates zeroed native storage inline.
§Safety
For handles with native methods, initialise the native state before calling those methods. Zeroed storage is not a connection.
Source§impl<S: ResourceStorage<aeron_async_add_exclusive_publication_t>> AeronAsyncAddExclusivePublication<S>
impl<S: ResourceStorage<aeron_async_add_exclusive_publication_t>> AeronAsyncAddExclusivePublication<S>
Sourcepub fn get_registration_id(&self) -> i64
pub fn get_registration_id(&self) -> i64
Gets the registration id for addition of the exclusive_publication. Note that using this after a call to poll the succeeds or errors is undefined behaviour. As the async_add_exclusive_publication_t may have been freed.
§Return
registration id for the exclusive_publication.
pub fn get_inner(&self) -> *mut aeron_async_add_exclusive_publication_t
Sourcepub unsafe fn get_inner_mut(
&self,
) -> &mut aeron_async_add_exclusive_publication_t
pub unsafe fn get_inner_mut( &self, ) -> &mut aeron_async_add_exclusive_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.
Sourcepub unsafe fn get_inner_ref(&self) -> &aeron_async_add_exclusive_publication_t
pub unsafe fn get_inner_ref(&self) -> &aeron_async_add_exclusive_publication_t
Borrow the native struct.
§Safety
No Rust or native call may mutate the struct while this reference is alive. Shared wrappers also require coordination with other threads.
Source§impl AeronAsyncAddExclusivePublication
impl AeronAsyncAddExclusivePublication
Sourcepub unsafe fn from_ptr(
ptr: *mut aeron_async_add_exclusive_publication_t,
) -> AeronAsyncAddExclusivePublication<Borrowed<aeron_async_add_exclusive_publication_t>>
pub unsafe fn from_ptr( ptr: *mut aeron_async_add_exclusive_publication_t, ) -> AeronAsyncAddExclusivePublication<Borrowed<aeron_async_add_exclusive_publication_t>>
Borrow a native pointer without taking ownership.
§Safety
The pointer must be non-null. It and its parents must remain live for every use. Calls must follow Aeron’s threading and aliasing rules.
Source§impl AeronAsyncAddExclusivePublication
impl AeronAsyncAddExclusivePublication
pub fn new( client: &Aeron, uri: &CStr, stream_id: i32, ) -> Result<Self, AeronCError>
pub fn poll(&self) -> Result<Option<AeronExclusivePublication>, AeronCError>
Sourcepub fn cancel(&self) -> Result<(), AeronCError>
pub fn cancel(&self) -> Result<(), AeronCError>
Cancels this operation and releases the pending Aeron registration. Dropping an unresolved poller also cancels it.
Does nothing after poll() returns Ok(Some(_)) or Err(_).
At that point Aeron has consumed the C struct and no registration
remains pending.
Sourcepub fn poll_blocking(
&self,
timeout: Duration,
) -> Result<AeronExclusivePublication, AeronCError>
pub fn poll_blocking( &self, timeout: Duration, ) -> Result<AeronExclusivePublication, AeronCError>
Polls synchronously until the async operation completes or timeout elapses.
For examples and tests. 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.
§Event loop example
// 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<S: Clone + ResourceStorage<aeron_async_add_exclusive_publication_t>> Clone for AeronAsyncAddExclusivePublication<S>
impl<S: Clone + ResourceStorage<aeron_async_add_exclusive_publication_t>> Clone for AeronAsyncAddExclusivePublication<S>
Source§fn clone(&self) -> AeronAsyncAddExclusivePublication<S>
fn clone(&self) -> AeronAsyncAddExclusivePublication<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more