pub struct Compact {
pub parts: Vec<Base64Url>,
}
Expand description
A collection of CompactPart
s that have been converted to Base64Url
Fields§
§parts: Vec<Base64Url>
Parts of the compact representation
Implementations§
source§impl 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
Trait Implementations§
source§impl<'de> Deserialize<'de> for Compact
impl<'de> Deserialize<'de> for Compact
source§fn 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
source§impl PartialEq for Compact
impl PartialEq for Compact
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.