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: A
–Z
, a
–z
, 0
–9
, -
, _
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
impl Base64UrlRef
sourcepub fn from_slice(raw: &[u8]) -> &Self
pub fn from_slice(raw: &[u8]) -> &Self
Transparently reinterprets the slice as base64
sourcepub fn from_mut_slice(raw: &mut [u8]) -> &mut Self
pub fn from_mut_slice(raw: &mut [u8]) -> &mut Self
Transparently reinterprets the mutable slice as base64
sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Calculates the expected length of the base64-encoding of this buffer
sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Provides mutable access to the underlying slice
Trait Implementations§
source§impl AsRef<Base64UrlRef> for Base64Url
impl AsRef<Base64UrlRef> for Base64Url
source§fn as_ref(&self) -> &Base64UrlRef
fn as_ref(&self) -> &Base64UrlRef
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Borrow<Base64UrlRef> for Base64Url
impl Borrow<Base64UrlRef> for Base64Url
source§fn borrow(&self) -> &Base64UrlRef
fn borrow(&self) -> &Base64UrlRef
Immutably borrows from an owned value. Read more
source§impl Debug for Base64UrlRef
impl Debug for Base64UrlRef
source§impl Display for Base64UrlRef
impl Display for Base64UrlRef
source§impl<'a> From<&'a [u8]> for &'a Base64UrlRef
impl<'a> From<&'a [u8]> for &'a Base64UrlRef
source§impl From<&Base64UrlRef> for Base64Url
impl From<&Base64UrlRef> for Base64Url
source§fn from(val: &Base64UrlRef) -> Self
fn from(val: &Base64UrlRef) -> Self
Converts to this type from the input type.
source§impl Hash for Base64UrlRef
impl Hash for Base64UrlRef
source§impl PartialEq<Base64Url> for Base64UrlRef
impl PartialEq<Base64Url> for Base64UrlRef
source§impl PartialEq<Base64UrlRef> for Base64Url
impl PartialEq<Base64UrlRef> for Base64Url
source§fn eq(&self, other: &Base64UrlRef) -> bool
fn eq(&self, other: &Base64UrlRef) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for Base64UrlRef
impl PartialEq for Base64UrlRef
source§fn eq(&self, other: &Base64UrlRef) -> bool
fn eq(&self, other: &Base64UrlRef) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Base64UrlRef
Available on crate feature serde
only.
impl Serialize for Base64UrlRef
Available on crate feature
serde
only.Serialize the underlying byte array as a base64 string