pub struct BearerToken(/* private fields */);Expand description
Bounded operation credential carried only by PUBLISH and DIAL.
Implementations§
Source§impl BearerToken
impl BearerToken
Sourcepub fn new(value: impl Into<String>) -> Result<Self, ProtocolError>
pub fn new(value: impl Into<String>) -> Result<Self, ProtocolError>
Creates a token when its UTF-8 byte length is within the wire limit.
Returns ProtocolError::FieldTooLong
when value exceeds MAX_BEARER_TOKEN_BYTES.
Sourcepub fn expose_secret(&self) -> &str
pub fn expose_secret(&self) -> &str
Returns the raw credential text for authorization or wire encoding.
Do not log or persist the returned value.
Trait Implementations§
Source§impl Clone for BearerToken
impl Clone for BearerToken
Source§impl Debug for BearerToken
impl Debug for BearerToken
impl Eq for BearerToken
Source§impl PartialEq for BearerToken
impl PartialEq for BearerToken
impl StructuralPartialEq for BearerToken
Auto Trait Implementations§
impl Freeze for BearerToken
impl RefUnwindSafe for BearerToken
impl Send for BearerToken
impl Sync for BearerToken
impl Unpin for BearerToken
impl UnsafeUnpin for BearerToken
impl UnwindSafe for BearerToken
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