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
[src]
Create an empty struct
fn with_capacity(capacity: usize) -> Self
[src]
Create an empty struct with some expected capacity
fn push(&mut self, part: &CompactPart) -> Result<(), Error>
[src]
Push a CompactPart
to the end
fn len(&self) -> usize
[src]
Returns the number of parts
fn is_empty(&self) -> bool
[src]
Returns whether there are no parts
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
fn decode(encoded: &str) -> Self
[src]
Convenience function to split an encoded compact representation into a list of Base64Url
.
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
fn to_string(&self) -> String
[src]
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
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Compact) -> bool
[src]
This method tests for !=
.
impl Clone for Compact
[src]
fn clone(&self) -> Compact
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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,
[src]
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>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more