[][src]Struct kompact::net::buffer::BufferChunk

pub struct BufferChunk { /* fields omitted */ }

BufferChunk is a lockable pinned byte-slice All modifications to the Chunk goes through the get_slice method

Methods

impl BufferChunk[src]

pub fn new() -> Self[src]

Allocate a new Default BufferChunk

pub fn from_chunk(raw_chunk: *mut dyn Chunk) -> Self[src]

Creates a BufferChunk using the given Chunk

pub fn len(&self) -> usize[src]

Get the length of the BufferChunk

pub unsafe fn get_slice(&mut self, from: usize, to: usize) -> &'static mut [u8][src]

Return a pointer to a subslice of the chunk

pub fn swap_buffer(&mut self, other: &mut BufferChunk)[src]

Swaps the pointers of the two buffers such that they effectively switch place

pub fn get_lease(&mut self, from: usize, to: usize) -> ChunkLease[src]

Returns a ChunkLease pointing to the subslice between from and toof the BufferChunk the returned lease is a consumable Buf.

pub fn get_free_lease(&mut self, from: usize, to: usize) -> ChunkLease[src]

Returns a ChunkLease pointing to the subslice between from and toof the BufferChunk the returned lease is a writable BufMut.

pub fn get_lock(&self) -> Arc<u8>[src]

Clones the lock, the BufferChunk will be locked until all given locks are deallocated

pub fn get_lock_mut(&mut self) -> &mut Arc<u8>[src]

Returns a mutable pointer to the associated lock.

pub fn free(&mut self) -> bool[src]

Returns true if this smart_buffer is available again

pub fn lock(&mut self)[src]

Locks the BufferChunk, it will not be writable nor will any leases be created before it has been unlocked.

Trait Implementations

impl Drop for BufferChunk[src]

impl Send for BufferChunk[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,