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

Convert this part into bytes

Convert a sequence of bytes into Self

Provided Methods

Base64 decode into Self

Serialize Self to some form and then base64URL Encode

Implementors