pub struct Base64<F, E = GeneralPurpose> {
pub format: F,
pub engine: E,
}Available on crate feature
base64 only.Expand description
Takes a FileFormat, encoding any the contents emitted by the format in Base64 before
writing to disk, and decoding contents emitted by the format from Base64 before parsing.
Fields§
§format: FThe FileFormat to be used.
engine: EThe Engine to be used.
Implementations§
Source§impl<F> Base64<F, GeneralPurpose>
impl<F> Base64<F, GeneralPurpose>
Sourcepub const fn with_standard(format: F) -> Self
pub const fn with_standard(format: F) -> Self
Sourcepub const fn with_standard_no_pad(format: F) -> Self
pub const fn with_standard_no_pad(format: F) -> Self
Creates a Base64 using the STANDARD_NO_PAD engine.
Sourcepub const fn with_url_safe(format: F) -> Self
pub const fn with_url_safe(format: F) -> Self
Sourcepub const fn with_url_safe_no_pad(format: F) -> Self
pub const fn with_url_safe_no_pad(format: F) -> Self
Creates a Base64 using the URL_SAFE_NO_PAD engine.
Trait Implementations§
Source§impl<F, E, T> FileFormat<T> for Base64<F, E>where
F: FileFormat<T>,
E: Engine,
impl<F, E, T> FileFormat<T> for Base64<F, E>where
F: FileFormat<T>,
E: Engine,
Source§type FormatError = <F as FileFormat<T>>::FormatError
type FormatError = <F as FileFormat<T>>::FormatError
The type of error to return from
to_writer and from_reader.Source§fn from_reader<R: Read>(&self, reader: R) -> Result<T, Self::FormatError>
fn from_reader<R: Read>(&self, reader: R) -> Result<T, Self::FormatError>
Deserialize a value from a
Read stream. Read moreSource§fn to_writer<W: Write>(
&self,
writer: W,
value: &T,
) -> Result<(), Self::FormatError>
fn to_writer<W: Write>( &self, writer: W, value: &T, ) -> Result<(), Self::FormatError>
Serialize a value into a
Write stream. Read moreSource§fn from_reader_buffered<R>(&self, reader: R) -> Result<T, Self::FormatError>where
R: Read,
fn from_reader_buffered<R>(&self, reader: R) -> Result<T, Self::FormatError>where
R: Read,
Identical to
FileFormat::from_reader, however the provided reader is buffered with BufReader. Read moreSource§fn from_buffer(&self, buf: &[u8]) -> Result<T, Self::FormatError>
fn from_buffer(&self, buf: &[u8]) -> Result<T, Self::FormatError>
Deserialize a value from a byte vec.
Source§fn to_writer_buffered<W>(
&self,
writer: W,
value: &T,
) -> Result<(), Self::FormatError>where
W: Write,
fn to_writer_buffered<W>(
&self,
writer: W,
value: &T,
) -> Result<(), Self::FormatError>where
W: Write,
Identical to
FileFormat::to_writer, however the provided writer is buffered with BufWriter. Read moreSource§impl<F, E, T> FileFormatUtf8<T> for Base64<F, E>where
F: FileFormat<T>,
E: Engine,
impl<F, E, T> FileFormatUtf8<T> for Base64<F, E>where
F: FileFormat<T>,
E: Engine,
Source§fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>
fn from_string_buffer(&self, buf: &str) -> Result<T, Self::FormatError>
Deserialize a buffer from a string slice.
Source§fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>
fn to_string_buffer(&self, value: &T) -> Result<String, Self::FormatError>
Serialize a value into a string buffer.
impl<F: Copy, E: Copy> Copy for Base64<F, E>
impl<F: Eq, E: Eq> Eq for Base64<F, E>
impl<F, E> StructuralPartialEq for Base64<F, E>
Auto Trait Implementations§
impl<F, E> Freeze for Base64<F, E>
impl<F, E> RefUnwindSafe for Base64<F, E>where
F: RefUnwindSafe,
E: RefUnwindSafe,
impl<F, E> Send for Base64<F, E>
impl<F, E> Sync for Base64<F, E>
impl<F, E> Unpin for Base64<F, E>
impl<F, E> UnwindSafe for Base64<F, E>where
F: UnwindSafe,
E: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.