Struct aliri_base64::Base64UrlRef[][src]

#[repr(transparent)]
pub struct Base64UrlRef(_);
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

impl Base64UrlRef[src]

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

Transparently reinterprets the slice as base64

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

Transparently reinterprets the mutable slice as base64

pub const fn encoded_len(&self) -> usize[src]

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

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

Provides access to the underlying slice

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

Provides mutable access to the underlying slice

Trait Implementations

impl AsRef<Base64UrlRef> for Base64Url[src]

fn as_ref(&self) -> &Base64UrlRef[src]

Performs the conversion.

impl Borrow<Base64UrlRef> for Base64Url[src]

fn borrow(&self) -> &Base64UrlRef[src]

Immutably borrows from an owned value. Read more

impl Debug for Base64UrlRef[src]

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

Formats the value using the given formatter. Read more

impl Display for Base64UrlRef[src]

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

Formats the value using the given formatter. Read more

impl From<&'_ Base64UrlRef> for Base64Url[src]

fn from(val: &Base64UrlRef) -> Self[src]

Performs the conversion.

impl<'a> From<&'a [u8]> for &'a Base64UrlRef[src]

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

Performs the conversion.

impl Hash for Base64UrlRef[src]

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

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl PartialEq<Base64Url> for Base64UrlRef[src]

fn eq(&self, other: &Base64Url) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Base64UrlRef> for Base64UrlRef[src]

fn eq(&self, other: &Base64UrlRef) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Base64UrlRef) -> bool[src]

This method tests for !=.

impl PartialEq<Base64UrlRef> for Base64Url[src]

fn eq(&self, other: &Base64UrlRef) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Serialize for Base64UrlRef[src]

This is supported on crate feature serde only.

Serialize the underlying byte array as a base64 string

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

Serialize this value into the given Serde serializer. Read more

impl ToOwned for Base64UrlRef[src]

type Owned = Base64Url

The resulting type after obtaining ownership.

fn to_owned(&self) -> Self::Owned[src]

Creates owned data from borrowed data, usually by cloning. Read more

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl Eq for Base64UrlRef[src]

impl StructuralEq for Base64UrlRef[src]

impl StructuralPartialEq for Base64UrlRef[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more