Struct aliri_base64::Base64Ref

source ·
pub struct Base64Ref(/* private fields */);
Expand description

Borrowed data to be encoded as standard base64

Encoding alphabet: AZ, az, 09, +, /

Padding character: =

Data is borrowed in its raw form. Costs of converting to base64 form are only incurred when serializing or displaying the value.

Implementations§

source§

impl Base64Ref

source

pub fn from_slice(raw: &[u8]) -> &Self

Transparently reinterprets the slice as base64

source

pub fn from_mut_slice(raw: &mut [u8]) -> &mut Self

Transparently reinterprets the mutable slice as base64

source

pub const fn encoded_len(&self) -> usize

Calculates the expected length of the base64-encoding of this buffer

source

pub const fn as_slice(&self) -> &[u8]

Provides access to the underlying slice

source

pub fn as_mut_slice(&mut self) -> &mut [u8]

Provides mutable access to the underlying slice

Trait Implementations§

source§

impl AsRef<Base64Ref> for Base64

source§

fn as_ref(&self) -> &Base64Ref

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<Base64Ref> for Base64

source§

fn borrow(&self) -> &Base64Ref

Immutably borrows from an owned value. Read more
source§

impl Debug for Base64Ref

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Base64Ref

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a [u8]> for &'a Base64Ref

source§

fn from(slice: &'a [u8]) -> Self

Converts to this type from the input type.
source§

impl From<&Base64Ref> for Base64

source§

fn from(val: &Base64Ref) -> Self

Converts to this type from the input type.
source§

impl Hash for Base64Ref

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
source§

impl PartialEq<Base64> for Base64Ref

source§

fn eq(&self, other: &Base64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Base64Ref> for Base64

source§

fn eq(&self, other: &Base64Ref) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for Base64Ref

source§

fn eq(&self, other: &Base64Ref) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Base64Ref

Available on crate feature serde only.

Serialize the underlying byte array as a base64 string

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl ToOwned for Base64Ref

§

type Owned = Base64

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for Base64Ref

source§

impl StructuralPartialEq for Base64Ref

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more