pub struct AeronCounter<S: ResourceStorage<aeron_counter_t> = LiveCResource<aeron_counter_t>> { /* private fields */ }Implementations§
Source§impl<S: ResourceStorage<aeron_counter_t>> AeronCounter<S>
impl<S: ResourceStorage<aeron_counter_t>> AeronCounter<S>
Sourcepub fn constants(
&self,
constants: &AeronCounterConstants<impl ResourceStorage<aeron_counter_constants_t>>,
) -> Result<i32, AeronCError>
pub fn constants( &self, constants: &AeronCounterConstants<impl ResourceStorage<aeron_counter_constants_t>>, ) -> Result<i32, AeronCError>
Sourcepub fn get_constants(
&self,
) -> Result<AeronCounterConstants<Inline<aeron_counter_constants_t>>, AeronCError>
pub fn get_constants( &self, ) -> Result<AeronCounterConstants<Inline<aeron_counter_constants_t>>, AeronCError>
Fill in a structure with the constants in use by a counter.
Sourcepub fn correlation_id(&self) -> Result<i64, AeronCError>
pub fn correlation_id(&self) -> Result<i64, AeronCError>
get_constants()?.correlation_id(). Call get_constants() once to read several fields
Sourcepub fn registration_id(&self) -> Result<i64, AeronCError>
pub fn registration_id(&self) -> Result<i64, AeronCError>
get_constants()?.registration_id(). Call get_constants() once to read several fields
Sourcepub fn counter_id(&self) -> Result<i32, AeronCError>
pub fn counter_id(&self) -> Result<i32, AeronCError>
get_constants()?.counter_id(). Call get_constants() once to read several fields
pub fn get_inner(&self) -> *mut aeron_counter_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_counter_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_counter_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_counter_t
pub unsafe fn get_inner_ref(&self) -> &aeron_counter_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 AeronCounter
impl AeronCounter
Sourcepub unsafe fn from_ptr(
ptr: *mut aeron_counter_t,
) -> AeronCounter<Borrowed<aeron_counter_t>>
pub unsafe fn from_ptr( ptr: *mut aeron_counter_t, ) -> AeronCounter<Borrowed<aeron_counter_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 AeronCounter
impl AeronCounter
Sourcepub fn close(self) -> Result<(), AeronCError>
pub fn close(self) -> Result<(), AeronCError>
Releases this handle. Native cleanup waits for the last owning clone when the resource can be retained by another handle.
Source§impl AeronCounter
impl AeronCounter
Sourcepub fn close_with_handler<AeronNotificationHandlerImpl: AeronNotificationCallback + Send + 'static>(
self,
on_close_complete: Option<&SharedHandler<AeronNotificationHandlerImpl>>,
) -> Result<(), AeronCError>
pub fn close_with_handler<AeronNotificationHandlerImpl: AeronNotificationCallback + Send + 'static>( self, on_close_complete: Option<&SharedHandler<AeronNotificationHandlerImpl>>, ) -> Result<(), AeronCError>
Like Self::close, but calls on_close_complete from the conductor once
the close finishes. Returns an error unless this is the last owning handle.
The client keeps the SharedHandler alive until it has fired
Source§impl AeronCounter
impl AeronCounter
pub fn addr_atomic(&self) -> &AtomicI64
Trait Implementations§
Source§impl<S: Clone + ResourceStorage<aeron_counter_t>> Clone for AeronCounter<S>
impl<S: Clone + ResourceStorage<aeron_counter_t>> Clone for AeronCounter<S>
Source§fn clone(&self) -> AeronCounter<S>
fn clone(&self) -> AeronCounter<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more