pub struct Blob<'a> { /* private fields */ }
Expand description
An SQL blob.
An eXtremeDB SQL blob is a large binary object that can contain arbitrary data.
This type contains public methods that allow the applications to read the
data. A blob keeps an internal read pointer; each read operation advances
it by the number of bytes read. To revert the pointer to the beginning of
the blob’s data, use the reset()
method.
A Value
can only be converted into a Blob
if it has the Blob
type. The opposite conversion is always possible.
Implementations§
Source§impl<'a> Blob<'a>
impl<'a> Blob<'a>
Sourcepub fn available(&self) -> Result<usize>
pub fn available(&self) -> Result<usize>
Returns the number of bytes available to be extracted with a single
get()
operation.
This is not the total size of the blob. If the blob is split into segments, this can be equal to the size of one segment.
Sourcepub fn get_into(&self, buf: &mut Vec<u8>) -> Result<()>
pub fn get_into(&self, buf: &mut Vec<u8>) -> Result<()>
Reads the blob data into the buffer.
This method will fill the buffer up to its capacity. If the number of bytes available for reading is smaller than the buffer’s capacity, this method will perform multiple reads.