pub struct Jwt<T> { /* private fields */ }
Implementations§
source§impl<T> Jwt<T>where
T: Serialize,
impl<T> Jwt<T>where
T: Serialize,
Jwt can be finalized to produce an encoded and signed string representation
Example
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate smpl_jwt;
use serde::Serialize;
use smpl_jwt::{Jwt, RSAKey};
fn main() {
#[derive(Serialize)]
struct ExampleStruct {
field: String
}
let rsa_key = match RSAKey::from_pem("random_rsa_for_testing") {
Ok(x) => x,
Err(e) => panic!("{}", e)
};
let jwt = Jwt::new(ExampleStruct{field: String::from("test")},
rsa_key,
None);
println!("{}", jwt);
}
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Jwt<T>where
T: RefUnwindSafe,
impl<T> Send for Jwt<T>where
T: Send,
impl<T> Sync for Jwt<T>where
T: Sync,
impl<T> Unpin for Jwt<T>where
T: Unpin,
impl<T> UnwindSafe for Jwt<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more