pub struct ScratchBuffer { /* private fields */ }Expand description
reusable storage for temporary slices and formatted text
Implementations§
Source§impl ScratchBuffer
impl ScratchBuffer
Sourcepub fn alloc<T: Copy>(&self, capacity: usize) -> Scratch<'_, T>
pub fn alloc<T: Copy>(&self, capacity: usize) -> Scratch<'_, T>
reserves capacity without initializing elements pushing past it grows in place while this is the newest guard and spills to the heap otherwise
Sourcepub fn fmt(&self, arguments: Arguments<'_>) -> ScratchStr<'_>
pub fn fmt(&self, arguments: Arguments<'_>) -> ScratchStr<'_>
formats arguments into temporary scratch storage
Sourcepub fn str<'a>(&'a self, source: StrSource<'a>) -> ScratchStr<'a>
pub fn str<'a>(&'a self, source: StrSource<'a>) -> ScratchStr<'a>
borrows text or formats arguments into temporary scratch storage
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ScratchBuffer
impl !RefUnwindSafe for ScratchBuffer
impl !Send for ScratchBuffer
impl !Sync for ScratchBuffer
impl Forget for ScratchBuffer
impl Move for ScratchBuffer
impl Unpin for ScratchBuffer
impl UnsafeUnpin for ScratchBufferwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Block>: UnsafeUnpin,
PhantomData<(u32, fn(*mut u8))>: UnsafeUnpin,
PhantomData<*mut ()>: UnsafeUnpin,
impl UnwindSafe for ScratchBuffer
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