[][src]Struct biscuit::Compact

pub struct Compact {
    pub parts: Vec<Base64Url>,
}

A collection of CompactParts that have been converted to Base64Url

Fields

parts: Vec<Base64Url>

Parts of the compact representation

Implementations

impl Compact[src]

pub fn new() -> Self[src]

Create an empty struct

pub fn with_capacity(capacity: usize) -> Self[src]

Create an empty struct with some expected capacity

pub fn push(&mut self, part: &dyn CompactPart) -> Result<(), Error>[src]

Push a CompactPart to the end

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

Returns the number of parts

pub fn is_empty(&self) -> bool[src]

Returns whether there are no parts

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

Encodes the various parts into Base64 URL encoding and then concatenates them with period '.' This corresponds to the various Compact representation in JWE and JWS, for example

pub fn decode(encoded: &str) -> Self[src]

Convenience function to split an encoded compact representation into a list of Base64Url.

pub fn part<T: CompactPart>(&self, index: usize) -> Result<T, Error>[src]

Convenience function to retrieve a part at a certain index and decode into the type desired

Trait Implementations

impl Clone for Compact[src]

impl Debug for Compact[src]

impl Default for Compact[src]

impl<'de> Deserialize<'de> for Compact[src]

impl Display for Compact[src]

impl Eq for Compact[src]

impl PartialEq<Compact> for Compact[src]

impl Serialize for Compact[src]

impl StructuralEq for Compact[src]

impl StructuralPartialEq for Compact[src]

Auto Trait Implementations

impl RefUnwindSafe for Compact

impl Send for Compact

impl Sync for Compact

impl Unpin for Compact

impl UnwindSafe for Compact

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.