pub struct StrBuffers { /* private fields */ }Expand description
Shared byte buffers backing long string views. A vector holding views into a decoded segment chunk, or into a frame’s Arrow data buffer, keeps what it points at alive without copying it.
Implementations§
Source§impl StrBuffers
impl StrBuffers
pub fn new() -> Self
Sourcepub fn push(&mut self, buf: Arc<[u8]>) -> u16
pub fn push(&mut self, buf: Arc<[u8]>) -> u16
Register an allocation of the engine’s own and get its id.
Sourcepub unsafe fn push_lent(
&mut self,
ptr: *const u8,
len: usize,
owner: Arc<dyn Any + Send + Sync>,
) -> u16
pub unsafe fn push_lent( &mut self, ptr: *const u8, len: usize, owner: Arc<dyn Any + Send + Sync>, ) -> u16
Register bytes from outside the engine and get their id.
§Safety
ptr must point at len initialized bytes that nobody writes
or frees for as long as owner lives, and dropping owner
must be what releases them. Holding it here is what makes that
last as long as the views do.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
How many buffers are registered, which is the id the next one will take.
pub fn is_empty(&self) -> bool
pub fn slice(&self, id: u16, offset: u32, len: usize) -> &[u8] ⓘ
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StrBuffers
impl !UnwindSafe for StrBuffers
impl Forget for StrBuffers
impl Freeze for StrBuffers
impl Move for StrBuffers
impl Send for StrBuffers
impl Sync for StrBuffers
impl Unpin for StrBuffers
impl UnsafeUnpin for StrBuffers
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
Mutably borrows from an owned value. Read more