Struct aliri_base64::Base64UrlRef

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

Borrowed data to be encoded as URL-safe base64 (no padding)

Encoding alphabet: AZ, az, 09, -, _

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 Base64UrlRef

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<Base64UrlRef> for Base64Url

source§

fn as_ref(&self) -> &Base64UrlRef

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

impl Borrow<Base64UrlRef> for Base64Url

source§

fn borrow(&self) -> &Base64UrlRef

Immutably borrows from an owned value. Read more
source§

impl Debug for Base64UrlRef

source§

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

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

impl Display for Base64UrlRef

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 Base64UrlRef

source§

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

Converts to this type from the input type.
source§

impl From<&Base64UrlRef> for Base64Url

source§

fn from(val: &Base64UrlRef) -> Self

Converts to this type from the input type.
source§

impl Hash for Base64UrlRef

source§

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

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

impl PartialEq<Base64Url> for Base64UrlRef

source§

fn eq(&self, other: &Base64Url) -> 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<Base64UrlRef> for Base64Url

source§

fn eq(&self, other: &Base64UrlRef) -> 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 Base64UrlRef

source§

fn eq(&self, other: &Base64UrlRef) -> 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 Base64UrlRef

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 Base64UrlRef

§

type Owned = Base64Url

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 Base64UrlRef

source§

impl StructuralPartialEq for Base64UrlRef

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