[][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

Methods

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

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

Alias of encode

Trait Implementations

impl PartialEq<Compact> for Compact[src]

impl Default for Compact[src]

impl Clone for Compact[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Compact[src]

impl Debug for Compact[src]

impl Serialize for Compact[src]

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

Auto Trait Implementations

impl Send for Compact

impl Sync for Compact

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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

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

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