Struct ethers_providers::JwtKey
source · pub struct JwtKey(/* private fields */);
Expand description
Generates a bearer token from a JWT secret
Implementations§
source§impl JwtKey
impl JwtKey
sourcepub fn from_slice(key: &[u8]) -> Result<Self, String>
pub fn from_slice(key: &[u8]) -> Result<Self, String>
Wrap given slice in Self
. Returns an error if slice.len() != JWT_SECRET_LENGTH
.
sourcepub fn from_hex(hex: &str) -> Result<Self, String>
pub fn from_hex(hex: &str) -> Result<Self, String>
Decode the given string from hex (no 0x prefix), and attempt to create a key from it.
sourcepub fn into_bytes(self) -> [u8; 32]
pub fn into_bytes(self) -> [u8; 32]
Consumes the key, returning its underlying byte array.
Auto Trait Implementations§
impl RefUnwindSafe for JwtKey
impl Send for JwtKey
impl Sync for JwtKey
impl Unpin for JwtKey
impl UnwindSafe for JwtKey
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