Trait biscuit::CompactPart
source · pub trait CompactPart {
fn to_bytes(&self) -> Result<Vec<u8>, Error>;
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
where
Self: Sized;
fn from_base64<B: AsRef<[u8]>>(encoded: &B) -> Result<Self, Error>
where
Self: Sized,
{ ... }
fn to_base64(&self) -> Result<Base64Url, Error> { ... }
}
Expand description
A “part” of the compact representation of JWT/JWS/JWE. Parts are first serialized to some form and then base64 encoded and separated by periods.
An automatic implementation for any T
that implements the marker trait CompactJson
is provided.
This implementation will serialize/deserialize T
to JSON via serde.
Required Methods
Provided Methods
Implementations on Foreign Types
sourceimpl CompactPart for Vec<u8>
impl CompactPart for Vec<u8>
Implementors
impl CompactPart for Base64Url
impl<T> CompactPart for Twhere
T: CompactJson,
impl<T: CompactPart, H: Serialize + DeserializeOwned> CompactPart for Compact<T, H>
Implementation for embedded inside a JWE.