pub struct AeronMpscRb { /* private fields */ }
Implementations§
Source§impl AeronMpscRb
impl AeronMpscRb
pub fn new( buffer: *mut u8, descriptor: &AeronRbDescriptor, capacity: usize, max_message_length: usize, ) -> Result<Self, AeronCError>
Sourcepub fn new_zeroed() -> Result<Self, AeronCError>
pub fn new_zeroed() -> Result<Self, AeronCError>
creates zeroed struct where the underlying c struct is on the heap
pub fn buffer(&self) -> *mut u8
pub fn descriptor(&self) -> AeronRbDescriptor
pub fn capacity(&self) -> usize
pub fn max_message_length(&self) -> usize
pub fn init( &self, buffer: *mut c_void, length: usize, ) -> Result<i32, AeronCError>
pub fn write( &self, msg_type_id: i32, msg: *const c_void, length: usize, ) -> aeron_rb_write_result_t
pub fn try_claim(&self, msg_type_id: i32, length: usize) -> i32
pub fn commit(&self, offset: i32) -> Result<i32, AeronCError>
pub fn abort(&self, offset: i32) -> Result<i32, AeronCError>
pub fn read<AeronRbHandlerHandlerImpl: AeronRbHandlerCallback>( &self, handler: Option<&Handler<AeronRbHandlerHandlerImpl>>, message_count_limit: usize, ) -> usize
Sourcepub fn read_once<AeronRbHandlerHandlerImpl: FnMut(i32, *const c_void, usize)>(
&self,
handler: AeronRbHandlerHandlerImpl,
message_count_limit: usize,
) -> usize
pub fn read_once<AeronRbHandlerHandlerImpl: FnMut(i32, *const c_void, usize)>( &self, handler: AeronRbHandlerHandlerImpl, message_count_limit: usize, ) -> usize
NOTE: aeron must not store this closure and instead use it immediately. If not you will get undefined behaviour, use with care
pub fn controlled_read<AeronRbControlledHandlerHandlerImpl: AeronRbControlledHandlerCallback>( &self, handler: Option<&Handler<AeronRbControlledHandlerHandlerImpl>>, message_count_limit: usize, ) -> usize
Sourcepub fn controlled_read_once<AeronRbControlledHandlerHandlerImpl: FnMut(i32, *const c_void, usize) -> aeron_rb_read_action_t>(
&self,
handler: AeronRbControlledHandlerHandlerImpl,
message_count_limit: usize,
) -> usize
pub fn controlled_read_once<AeronRbControlledHandlerHandlerImpl: FnMut(i32, *const c_void, usize) -> aeron_rb_read_action_t>( &self, handler: AeronRbControlledHandlerHandlerImpl, message_count_limit: usize, ) -> usize
NOTE: aeron must not store this closure and instead use it immediately. If not you will get undefined behaviour, use with care
pub fn next_correlation_id(&self) -> i64
pub fn consumer_heartbeat_time(&self, now_ms: i64)
pub fn consumer_heartbeat_time_value(&self) -> i64
pub fn unblock(&self) -> bool
pub fn get_inner(&self) -> *mut aeron_mpsc_rb_t
Source§impl AeronMpscRb
impl AeronMpscRb
Sourcepub fn clone_struct(&self) -> Self
pub fn clone_struct(&self) -> Self
Regular clone just increases the reference count of underlying count.
clone_struct
shallow copies the content of the underlying struct on heap.
NOTE: if the struct has references to other structs these will not be copied
Must be only used on structs which has no init/clean up methods. So its danagerous to use with Aeron/AeronContext/AeronPublication/AeronSubscription More intended for AeronArchiveRecordingDescriptor
Source§impl AeronMpscRb
impl AeronMpscRb
pub fn buffer_mut(&self) -> &mut [u8] ⓘ
pub fn buffer_at_mut(&self, idx: usize, len: usize) -> &mut [u8] ⓘ
Source§impl AeronMpscRb
impl AeronMpscRb
pub fn try_claim_slice<'a>( &'a self, msg_type_id: i32, length: usize, ) -> Result<AeronMpscRbSlot<'a>, AeronCError>
pub fn from_slice( buffer: &mut [u8], max_msg_size: usize, ) -> Result<Self, AeronCError>
pub fn new_with_capacity( capacity: usize, max_msg_size: usize, ) -> Result<Self, AeronCError>
Source§impl AeronMpscRb
impl AeronMpscRb
pub fn read_msgs<T: AeronRingBufferHandlerCallback>( &self, handler: &Handler<AeronRingBufferHandlerWrapper<T>>, message_count_limit: usize, ) -> usize
pub fn controlled_read_msgs<T: AeronRingBufferControlledHandlerCallback>( &self, handler: &Handler<AeronRingBufferControlledHandlerWrapper<T>>, message_count_limit: usize, ) -> usize
Trait Implementations§
Source§impl Clone for AeronMpscRb
impl Clone for AeronMpscRb
Source§fn clone(&self) -> AeronMpscRb
fn clone(&self) -> AeronMpscRb
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AeronMpscRb
impl Debug for AeronMpscRb
Source§impl Default for AeronMpscRb
impl Default for AeronMpscRb
This will create an instance where the struct is zeroed, use with care