[−][src]Trait lib3h_crypto_api::Buffer
The Buffer trait is used by crypto_api functions to exchange data.
It is implemented for Vec
Required methods
fn new(size: usize) -> CryptoResult<Self>
Create a new Buffer instance of given type
fn len(&self) -> usize
Get the length of this buffer
fn set_no_access(&self)
Mark the buffer as no-access (secure)
fn set_readable(&self)
Mark the buffer as read-only (see read_lock)
fn set_writable(&self)
Mark the buffer as read-write (see write_lock)
Provided methods
fn read_lock(&self) -> ReadLocker<Self>
Mark the buffer as readable (read-only) When the returned ReadLocker instance is dropped, the buffer will be marked no-access.
fn write_lock(&mut self) -> WriteLocker<Self>
Mark the buffer as writable (read-write) When the returned WriteLocker instance is dropped, the buffer will be marked no-access.
fn write(&mut self, offset: usize, data: &[u8]) -> CryptoResult<()>
Write data to this Buffer instance