pub struct Buffers {
pub src: Vec<u8>,
pub dest: Vec<u8>,
}Expand description
A utility to do buffer-swapping with.
Use src to read from and dest to write to, and after actually changing data, call Buffers::swap().
To be able to repeat the process, this time using what was dest as src, freeing up dest for writing once more.
Note that after each Buffers::swap(), src is the most recent version of the data, just like before each swap.
Fields§
§src: Vec<u8>The source data, as basis for processing.
dest: Vec<u8>The data produced after processing src.
Implementations§
source§impl Buffers
impl Buffers
Lifecycle
sourcepub fn use_foreign_src<'a, 'src>(
&'a mut self,
src: &'src [u8]
) -> WithForeignSource<'src, 'a>
pub fn use_foreign_src<'a, 'src>( &'a mut self, src: &'src [u8] ) -> WithForeignSource<'src, 'a>
Use this if there is an input buffer src which isn’t owned by you, but which should be used as source when
asking for src_and_dest().
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Buffers
impl Send for Buffers
impl Sync for Buffers
impl Unpin for Buffers
impl UnwindSafe for Buffers
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