Expand description
A collection of CompactPart
s that have been converted to Base64Url
Fields
parts: Vec<Base64Url>
Parts of the compact representation
Implementations
sourceimpl Compact
impl Compact
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an empty struct with some expected capacity
sourcepub fn push(&mut self, part: &dyn CompactPart) -> Result<(), Error>
pub fn push(&mut self, part: &dyn CompactPart) -> Result<(), Error>
Push a CompactPart
to the end
sourcepub fn encode(&self) -> String
pub 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
sourcepub fn decode(encoded: &str) -> Self
pub fn decode(encoded: &str) -> Self
Convenience function to split an encoded compact representation into a list of Base64Url
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Compact
impl<'de> Deserialize<'de> for Compact
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Compact
impl StructuralEq for Compact
impl StructuralPartialEq for Compact
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.