Trait biscuit::CompactPart
[−]
[src]
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> { ... } }
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
fn to_bytes(&self) -> Result<Vec<u8>, Error>
Convert this part into bytes
fn from_bytes(bytes: &[u8]) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Convert a sequence of bytes into Self
Provided Methods
fn from_base64<B: AsRef<[u8]>>(encoded: &B) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Base64 decode into Self
fn to_base64(&self) -> Result<Base64Url, Error>
Serialize Self
to some form and then base64URL Encode
Implementations on Foreign Types
impl CompactPart for Vec<u8>
[src]
Implementors
impl<T: CompactPart, H: Serialize + DeserializeOwned> CompactPart for Compact<T, H>
impl<T> CompactPart for T where
T: CompactJson,impl CompactPart for Base64Url