pub struct AeronIdleStrategy<S: ResourceStorage<aeron_idle_strategy_t> = CResource<aeron_idle_strategy_t>> { /* private fields */ }Implementations§
Source§impl AeronIdleStrategy<CResource<aeron_idle_strategy_t>>
impl AeronIdleStrategy<CResource<aeron_idle_strategy_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() -> AeronIdleStrategy<Inline<aeron_idle_strategy_t>>
pub unsafe fn new_zeroed_on_stack() -> AeronIdleStrategy<Inline<aeron_idle_strategy_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 AeronIdleStrategy
impl AeronIdleStrategy
Sourcepub unsafe fn sleeping_idle(state: *mut c_void, work_count: c_int)
pub unsafe fn sleeping_idle(state: *mut c_void, work_count: c_int)
§Safety
Raw pointer arguments must have the size, alignment, initialization and lifetime required by the native function. Writable pointers require exclusive access. Keep any retained pointers valid until native cleanup.
pub fn yielding_idle(state: *mut c_void, work_count: c_int)
pub fn busy_spinning_idle(state: *mut c_void, work_count: c_int)
pub fn noop_idle(state: *mut c_void, work_count: c_int)
Source§impl<S: ResourceStorage<aeron_idle_strategy_t>> AeronIdleStrategy<S>
impl<S: ResourceStorage<aeron_idle_strategy_t>> AeronIdleStrategy<S>
pub fn idle(&self) -> aeron_idle_strategy_func_t
pub fn init(&self) -> aeron_idle_strategy_init_func_t
pub fn get_inner(&self) -> *mut aeron_idle_strategy_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_idle_strategy_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_idle_strategy_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_idle_strategy_t
pub unsafe fn get_inner_ref(&self) -> &aeron_idle_strategy_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 AeronIdleStrategy
impl AeronIdleStrategy
Sourcepub unsafe fn from_ptr(
ptr: *mut aeron_idle_strategy_t,
) -> AeronIdleStrategy<Borrowed<aeron_idle_strategy_t>>
pub unsafe fn from_ptr( ptr: *mut aeron_idle_strategy_t, ) -> AeronIdleStrategy<Borrowed<aeron_idle_strategy_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 unsafe fn from_native(
value: aeron_idle_strategy_t,
) -> AeronIdleStrategy<Inline<aeron_idle_strategy_t>>
pub unsafe fn from_native( value: aeron_idle_strategy_t, ) -> AeronIdleStrategy<Inline<aeron_idle_strategy_t>>
Copy a native struct into inline storage.
§Safety
Pointer fields must stay valid for every use of the returned handle.
Trait Implementations§
Source§impl<S: Clone + ResourceStorage<aeron_idle_strategy_t>> Clone for AeronIdleStrategy<S>
impl<S: Clone + ResourceStorage<aeron_idle_strategy_t>> Clone for AeronIdleStrategy<S>
Source§fn clone(&self) -> AeronIdleStrategy<S>
fn clone(&self) -> AeronIdleStrategy<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more