pub struct AeronCounterConstants<S: ResourceStorage<aeron_counter_constants_t> = CResource<aeron_counter_constants_t>> { /* private fields */ }Expand description
Configuration for a counter that does not change during its lifetime.
Implementations§
Source§impl AeronCounterConstants<CResource<aeron_counter_constants_t>>
impl AeronCounterConstants<CResource<aeron_counter_constants_t>>
pub fn new( correlation_id: i64, registration_id: i64, counter_id: i32, ) -> Result<Self, AeronCError>
Sourcepub fn new_zeroed_on_heap() -> Self
pub fn new_zeroed_on_heap() -> Self
Creates zeroed native storage on the heap.
Sourcepub fn new_zeroed_on_stack() -> AeronCounterConstants<Inline<aeron_counter_constants_t>>
pub fn new_zeroed_on_stack() -> AeronCounterConstants<Inline<aeron_counter_constants_t>>
Creates zeroed native storage inline.
Source§impl<S: ResourceStorage<aeron_counter_constants_t>> AeronCounterConstants<S>
impl<S: ResourceStorage<aeron_counter_constants_t>> AeronCounterConstants<S>
pub fn correlation_id(&self) -> i64
pub fn registration_id(&self) -> i64
pub fn counter_id(&self) -> i32
pub fn get_inner(&self) -> *mut aeron_counter_constants_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_counter_constants_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_counter_constants_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_constants_t
pub unsafe fn get_inner_ref(&self) -> &aeron_counter_constants_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 AeronCounterConstants
impl AeronCounterConstants
Sourcepub unsafe fn from_ptr(
ptr: *mut aeron_counter_constants_t,
) -> AeronCounterConstants<Borrowed<aeron_counter_constants_t>>
pub unsafe fn from_ptr( ptr: *mut aeron_counter_constants_t, ) -> AeronCounterConstants<Borrowed<aeron_counter_constants_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.
Sourcepub fn from_native(
value: aeron_counter_constants_t,
) -> AeronCounterConstants<Inline<aeron_counter_constants_t>>
pub fn from_native( value: aeron_counter_constants_t, ) -> AeronCounterConstants<Inline<aeron_counter_constants_t>>
Copy a native struct into inline storage.
Source§impl<S: ResourceStorage<aeron_counter_constants_t>> AeronCounterConstants<S>
impl<S: ResourceStorage<aeron_counter_constants_t>> AeronCounterConstants<S>
Sourcepub fn clone_struct(
&self,
) -> AeronCounterConstants<CResource<aeron_counter_constants_t>>
pub fn clone_struct( &self, ) -> AeronCounterConstants<CResource<aeron_counter_constants_t>>
Copies the underlying struct into a new heap allocation
Only for plain data structs with no init or clean-up functions, so not for Aeron, AeronContext, AeronPublication or AeronSubscription
The struct holds no pointers, so the copy does not depend on the source
Trait Implementations§
Source§impl<S: Clone + ResourceStorage<aeron_counter_constants_t>> Clone for AeronCounterConstants<S>
impl<S: Clone + ResourceStorage<aeron_counter_constants_t>> Clone for AeronCounterConstants<S>
Source§fn clone(&self) -> AeronCounterConstants<S>
fn clone(&self) -> AeronCounterConstants<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more