pub struct BufferPtr { /* private fields */ }Implementations§
Source§impl BufferPtr
impl BufferPtr
pub unsafe fn id(&self) -> u32
pub unsafe fn data(&self) -> *mut u8
pub unsafe fn slice(&self, range: Range<usize>) -> &[u8] ⓘ
pub unsafe fn slice_mut(&self, range: Range<usize>) -> &mut [u8] ⓘ
Sourcepub unsafe fn set_next(&self, next: Option<BufferPtr>)
pub unsafe fn set_next(&self, next: Option<BufferPtr>)
SAFETY: this method must not be called concurrently from multiple threads.
Sourcepub unsafe fn swap_next(&self, new_next: Option<BufferPtr>) -> Option<BufferPtr>
pub unsafe fn swap_next(&self, new_next: Option<BufferPtr>) -> Option<BufferPtr>
SAFETY: this method must not be called concurrently from multiple threads.
Sourcepub unsafe fn get_next(&self) -> Option<BufferPtr>
pub unsafe fn get_next(&self) -> Option<BufferPtr>
SAFETY: this method must not be called concurrently with set_next or swap_next from multiple threads.
Sourcepub unsafe fn set_writer_id(&self, writer_id: usize)
pub unsafe fn set_writer_id(&self, writer_id: usize)
SAFETY: you must have exclusive access to this buffer.
Sourcepub unsafe fn release(self)
pub unsafe fn release(self)
Release this buffer back to the pool it was acquired from.
SAFETY: you must have exclusive access to this buffer.
Sourcepub unsafe fn initialize_rc(&self, count: u32, local_shared: u32, shared: u32)
pub unsafe fn initialize_rc(&self, count: u32, local_shared: u32, shared: u32)
You must ensure that you have exclusive access to the reference count of the buffer - that no other threads try to take or release references to this buffer between this buffer being acquired from the pool and the call to this method.
Sourcepub unsafe fn send(&self) -> u32
pub unsafe fn send(&self) -> u32
Used when converting a LocalPacket into a sendable Packet. Increments the shared reference count and decrements the thread-local reference count.
Returns the shared_rc_contribution value that the receiving thread should add to its own.
Sourcepub unsafe fn send_bulk(&self, count: u32) -> u32
pub unsafe fn send_bulk(&self, count: u32) -> u32
Used when converting a LocalPacket into a sendable Packet. Increments the shared reference count and decrements the thread-local reference count.
Returns the shared_rc_contribution value that the receiving thread should add to its own.
Sourcepub unsafe fn receive(&self, shared_rc_contribution: u32)
pub unsafe fn receive(&self, shared_rc_contribution: u32)
Used when converting a LocalPacket into a sendable Packet. Increments the shared reference count and decrements the thread-local reference count.
pub unsafe fn take_ref(&self, count: u32) -> u32
pub unsafe fn release_ref(&self, count: u32)
Trait Implementations§
Source§impl IFulfillment for BufferPtr
impl IFulfillment for BufferPtr
Source§impl Ord for BufferPtr
impl Ord for BufferPtr
Source§impl PartialOrd for BufferPtr
impl PartialOrd for BufferPtr
impl Copy for BufferPtr
impl Eq for BufferPtr
impl Send for BufferPtr
impl StructuralPartialEq for BufferPtr
impl Sync for BufferPtr
Auto Trait Implementations§
impl Freeze for BufferPtr
impl !RefUnwindSafe for BufferPtr
impl Unpin for BufferPtr
impl !UnwindSafe for BufferPtr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.