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<Empty, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Empty, <__D as Deserializer<'de>>::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
source§impl Serialize for Empty
impl Serialize for Empty
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
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.