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
extern crate biscuit;
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
sourceimpl<'de> Deserialize<'de> for Empty
impl<'de> Deserialize<'de> for Empty
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 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
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<T> CompactPart for Twhere
T: CompactJson,
impl<T> CompactPart for Twhere
T: CompactJson,
sourcefn to_bytes(&self) -> Result<Vec<u8, Global>, Error>
fn to_bytes(&self) -> Result<Vec<u8, Global>, Error>
JSON serialize the part and return the JSON string bytes
sourcefn from_bytes(bytes: &[u8]) -> Result<T, Error>
fn from_bytes(bytes: &[u8]) -> Result<T, Error>
Convert a sequence of bytes into Self
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.