Struct biscuit::Compact
[−]
[src]
pub struct Compact { pub parts: Vec<Base64Url>, }
A collection of CompactPart
s that have been converted to Base64Url
Fields
parts: Vec<Base64Url>
Parts of the compact representation
Methods
impl Compact
[src]
fn new() -> Self
Create an empty struct
fn with_capacity(capacity: usize) -> Self
Create an empty struct with some expected capacity
fn push(&mut self, part: &CompactPart) -> Result<(), Error>
Push a CompactPart
to the end
fn len(&self) -> usize
Returns the number of parts
fn is_empty(&self) -> bool
Returns whether there are no parts
fn encode(&self) -> String
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
fn decode(encoded: &str) -> Self
Convenience function to split an encoded compact representation into a list of Base64Url
.
fn part<T: CompactPart>(&self, index: usize) -> Result<T, Error>
Convenience function to retrieve a part at a certain index and decode into the type desired
fn to_string(&self) -> String
Alias of encode
Trait Implementations
impl Debug for Compact
[src]
impl Eq for Compact
[src]
impl PartialEq for Compact
[src]
fn eq(&self, __arg_0: &Compact) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Compact) -> bool
This method tests for !=
.
impl Clone for Compact
[src]
fn clone(&self) -> Compact
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for Compact
[src]
impl Serialize for Compact
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Compact
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more