pub struct Empty {}
Expand description
An empty struct that derives Serialize and Deserialize. Can be used, for example, in places where a type
for custom values (such as private claims in a ClaimsSet
) is required but you have nothing to implement.
Examples
use std::str::FromStr;
use biscuit::*;
use biscuit::jws::*;
use biscuit::jwa::*;
let claims_set = ClaimsSet::<biscuit::Empty> {
registered: RegisteredClaims {
issuer: Some(FromStr::from_str("https://www.acme.com").unwrap()),
subject: Some(FromStr::from_str("John Doe").unwrap()),
audience:
Some(SingleOrMultiple::Single(FromStr::from_str("htts://acme-customer.com").unwrap())),
not_before: Some(1234.into()),
..Default::default()
},
private: Default::default(),
};
let expected_jwt = JWT::new_decoded(From::from(
RegisteredHeader {
algorithm: SignatureAlgorithm::HS256,
..Default::default()
}),
claims_set);
Trait Implementations§
source§impl<'de> Deserialize<'de> for Empty
impl<'de> Deserialize<'de> for Empty
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<Empty> for Empty
impl PartialEq<Empty> for Empty
impl CompactJson for Empty
impl Copy for Empty
impl Eq for Empty
impl StructuralEq for Empty
impl StructuralPartialEq for Empty
Auto Trait Implementations§
impl RefUnwindSafe for Empty
impl Send for Empty
impl Sync for Empty
impl Unpin for Empty
impl UnwindSafe for Empty
Blanket Implementations§
source§impl<T> CompactPart for Twhere
T: CompactJson,
impl<T> CompactPart for Twhere T: CompactJson,
source§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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.