Struct biscuit::Empty [−][src]
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
impl Clone for Empty
[src]
impl CompactJson for Empty
[src]
impl Copy for Empty
[src]
impl Debug for Empty
[src]
impl Default for Empty
[src]
impl<'de> Deserialize<'de> for Empty
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Empty
[src]
impl PartialEq<Empty> for Empty
[src]
impl Serialize for Empty
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Empty
[src]
impl StructuralPartialEq for Empty
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CompactPart for T where
T: CompactJson,
[src]
T: CompactJson,
pub fn to_bytes(&Self) -> Result<Vec<u8, Global>, Error>
[src]
JSON serialize the part and return the JSON string bytes
pub fn from_bytes(&[u8]) -> Result<T, Error>
[src]
fn from_base64<B: AsRef<[u8]>>(encoded: &B) -> Result<Self, Error> where
Self: Sized,
[src]
Self: Sized,
fn to_base64(&self) -> Result<Base64Url, Error>
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,