[−][src]Struct blob::Blob
Blob structure containing binary data
Interally, the blob is stored as a plain Vec<u8>
, and some
methods are exposed from that. If you need full access to the
underlying Vec
, use borrow()
or borrow_mut()
Methods
impl<C: Config> Blob<C>
[src]
impl<C: Config> Blob<C>
ⓘImportant traits for Blob<C>
pub fn new() -> Blob<C> | [src] |
Create a new empty Blob
ⓘImportant traits for Blob<C>
pub fn from_vec(vec: Vec<u8>) -> Blob<C> | [src] |
Create a Blob
from an underlying Vec
ⓘImportant traits for Blob<C>
pub fn with_capacity(capacity: usize) -> Blob<C> | [src] |
Create a new Blob
with the given capacity
pub fn capacity(&self) -> usize | [src] |
Returns the number of bytes the Blob
can hold without reallocating.
pub fn reserve(&mut self, additional: usize) | [src] |
Reserves capacity for at least additional more bytes to be inserted in the given Blob
ⓘImportant traits for Blob<C>
pub fn with_config<E: Config>(self) -> Blob<E> | [src] |
Use a different encoding configuration for the Blob
pub fn encode_base64(&self) -> String | [src] |
Encode the Blob
to a base-64 string
pub fn encode_to<W: Write>(&self, writer: W) -> Result<()> | [src] |
Encodes the Blob
as base-64 to an io::Writer
, avoiding intermediate allocations
pub fn decode_base64<T>(encoded: T) -> Result<Blob<C>, DecodeError> where | [src] |
Decode base-64 encoded data into a Blob
pub fn append_base64<T>(&mut self, encoded: T) -> Result<(), DecodeError> where | [src] |
Decodes some base-64 data and appends it to the Blob
pub fn into_vec(self) -> Vec<u8> | [src] |
Consume self and return the inner Vec<u8>
Trait Implementations
impl<T, C: Config> From<T> for Blob<C> where
T: Into<Vec<u8>>,
[src]
impl<T, C: Config> From<T> for Blob<C> where
T: Into<Vec<u8>>,
impl<C: Config> IntoIterator for Blob<C>
[src]
impl<C: Config> IntoIterator for Blob<C>
type Item = u8
The type of the elements being iterated over.
type IntoIter = IntoIter<u8>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<'a, C: Config> IntoIterator for &'a Blob<C>
[src]
impl<'a, C: Config> IntoIterator for &'a Blob<C>
type Item = &'a u8
The type of the elements being iterated over.
type IntoIter = Iter<'a, u8>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<'a, C: Config> IntoIterator for &'a mut Blob<C>
[src]
impl<'a, C: Config> IntoIterator for &'a mut Blob<C>
type Item = &'a mut u8
The type of the elements being iterated over.
type IntoIter = IterMut<'a, u8>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<C: Config> Eq for Blob<C>
[src]
impl<C: Config> Eq for Blob<C>
impl<C: Config> Extend<u8> for Blob<C>
[src]
impl<C: Config> Extend<u8> for Blob<C>
fn extend<T>(&mut self, iter: T) where | [src] |
impl<'a, C: Config> Extend<&'a u8> for Blob<C>
[src]
impl<'a, C: Config> Extend<&'a u8> for Blob<C>
fn extend<T>(&mut self, iter: T) where | [src] |
impl<C: Config> AsMut<[u8]> for Blob<C>
[src]
impl<C: Config> AsMut<[u8]> for Blob<C>
impl<C: Config> AsMut<Vec<u8>> for Blob<C>
[src]
impl<C: Config> AsMut<Vec<u8>> for Blob<C>
impl<C: Config> Default for Blob<C>
[src]
impl<C: Config> Default for Blob<C>
impl<C: Config> PartialEq<Blob<C>> for Blob<C>
[src]
impl<C: Config> PartialEq<Blob<C>> for Blob<C>
fn eq(&self, other: &Self) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=
.
impl<T, C: Config> PartialEq<T> for Blob<C> where
Vec<u8>: PartialEq<T>,
[src]
impl<T, C: Config> PartialEq<T> for Blob<C> where
Vec<u8>: PartialEq<T>,
fn eq(&self, other: &T) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=
.
impl<C: Config> AsRef<[u8]> for Blob<C>
[src]
impl<C: Config> AsRef<[u8]> for Blob<C>
impl<C: Config> AsRef<Vec<u8>> for Blob<C>
[src]
impl<C: Config> AsRef<Vec<u8>> for Blob<C>
impl<C: Config> Clone for Blob<C>
[src]
impl<C: Config> Clone for Blob<C>
ⓘImportant traits for Blob<C>
fn clone(&self) -> Blob<C> | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl<C: Config> Debug for Blob<C>
[src]
impl<C: Config> Debug for Blob<C>
impl<C: Config> Display for Blob<C>
[src]
impl<C: Config> Display for Blob<C>
impl<C: Config> DerefMut for Blob<C>
[src]
impl<C: Config> DerefMut for Blob<C>
impl<C: Config> Deref for Blob<C>
[src]
impl<C: Config> Deref for Blob<C>
impl<C: Config> Hash for Blob<C>
[src]
impl<C: Config> Hash for Blob<C>
fn hash<H: Hasher>(&self, state: &mut H) | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl<C: Config> FromIterator<u8> for Blob<C>
[src]
impl<C: Config> FromIterator<u8> for Blob<C>
ⓘImportant traits for Blob<C>
fn from_iter<I>(iter: I) -> Blob<C> where | [src] |
impl<C: Config> FromStr for Blob<C>
[src]
impl<C: Config> FromStr for Blob<C>
type Err = DecodeError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err> | [src] |
impl<C: Config> Borrow<Vec<u8>> for Blob<C>
[src]
impl<C: Config> Borrow<Vec<u8>> for Blob<C>
impl<C: Config> Write for Blob<C>
[src]
impl<C: Config> Write for Blob<C>
fn write(&mut self, buf: &[u8]) -> Result<usize> | [src] |
fn write_all(&mut self, buf: &[u8]) -> Result<()> | [src] |
fn flush(&mut self) -> Result<()> | [src] |
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error> | 1.0.0 [src] |
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self | 1.0.0 [src] |
Creates a "by reference" adaptor for this instance of Write
. Read more
impl<C: Config> BorrowMut<Vec<u8>> for Blob<C>
[src]
impl<C: Config> BorrowMut<Vec<u8>> for Blob<C>
fn borrow_mut(&mut self) -> &mut Vec<u8> | [src] |
impl<C: Config> Serialize for Blob<C>
[src]
impl<C: Config> Serialize for Blob<C>
impl<'de, C: Config> Deserialize<'de> for Blob<C>
[src]
impl<'de, C: Config> Deserialize<'de> for Blob<C>
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where | [src] |
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<I> IntoIterator for I where
I: Iterator,
[src]
impl<I> IntoIterator for I where
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I | [src] |
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
fn write_u8(&mut self, n: u8) -> Result<(), Error> |
Writes an unsigned 8 bit integer to the underlying writer. Read more
fn write_i8(&mut self, n: i8) -> Result<(), Error> |
Writes a signed 8 bit integer to the underlying writer. Read more
fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where |
Writes an unsigned 16 bit integer to the underlying writer. Read more
fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where |
Writes a signed 16 bit integer to the underlying writer. Read more
fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where |
Writes an unsigned 24 bit integer to the underlying writer. Read more
fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where |
Writes a signed 24 bit integer to the underlying writer. Read more
fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where |
Writes an unsigned 32 bit integer to the underlying writer. Read more
fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where |
Writes a signed 32 bit integer to the underlying writer. Read more
fn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where |
Writes an unsigned 48 bit integer to the underlying writer. Read more
fn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where |
Writes a signed 48 bit integer to the underlying writer. Read more
fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where |
Writes an unsigned 64 bit integer to the underlying writer. Read more
fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where |
Writes a signed 64 bit integer to the underlying writer. Read more
fn write_u128<T>(&mut self, n: u128) -> Result<(), Error> where |
Writes an unsigned 128 bit integer to the underlying writer.
fn write_i128<T>(&mut self, n: i128) -> Result<(), Error> where |
Writes a signed 128 bit integer to the underlying writer.
fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where |
Writes an unsigned n-bytes integer to the underlying writer. Read more
fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where |
Writes a signed n-bytes integer to the underlying writer. Read more
fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error> where |
Writes an unsigned n-bytes integer to the underlying writer. Read more
fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error> where |
Writes a signed n-bytes integer to the underlying writer. Read more
fn write_f32<T>(&mut self, n: f32) -> Result<(), Error> where |
Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more
fn write_f64<T>(&mut self, n: f64) -> Result<(), Error> where |
Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,