[−][src]Struct kompact::net::buffer::BufferChunk
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 to
of 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 to
of 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
Auto Trait Implementations
impl !RefUnwindSafe for BufferChunk
impl !Sync for BufferChunk
impl Unpin for BufferChunk
impl !UnwindSafe for BufferChunk
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,