[−][src]Struct extremedb::sql::value::Blob
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
impl<'a> Blob<'a>
[src]
pub fn available(&self) -> Result<usize>
[src]
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.
pub fn get_into(&self, buf: &mut Vec<u8>) -> Result<()>
[src]
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.
pub fn get(&self, size: usize) -> Result<Vec<u8>>
[src]
Reads the given number of bytes from the blob.
If the number of bytes available for reading is smaller than the requested size, this method will perform multiple reads.
pub fn reset(&self) -> Result<()>
[src]
Resets the blob's read pointer.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Blob<'a>
impl<'a> !Send for Blob<'a>
impl<'a> !Sync for Blob<'a>
impl<'a> Unpin for Blob<'a>
impl<'a> UnwindSafe for Blob<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,