[][src]Struct biscuit::Empty

pub struct Empty {}

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]

impl Eq for Empty[src]

impl PartialEq<Empty> for Empty[src]

impl Serialize for Empty[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CompactPart for T where
    T: CompactJson
[src]

pub fn to_bytes(&Self) -> Result<Vec<u8>, Error>[src]

JSON serialize the part and return the JSON string bytes

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.