[−][src]Struct biscuit::Compact
A collection of CompactPart
s 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(&self) -> 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]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,