Struct biscuit::Empty [] [src]

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

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

impl Debug for Empty
[src]

[src]

Formats the value using the given formatter.

impl Eq for Empty
[src]

impl PartialEq for Empty
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Clone for Empty
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Empty
[src]

impl Default for Empty
[src]

[src]

Returns the "default value" for a type. Read more

impl CompactJson for Empty
[src]