pub struct ApiKey { /* private fields */ }Expand description
A parsed OpenApp API-key token.
Implementations§
Source§impl ApiKey
impl ApiKey
Sourcepub fn parse(token: impl Into<String>) -> Result<ApiKey, TokenFormatError>
pub fn parse(token: impl Into<String>) -> Result<ApiKey, TokenFormatError>
Parse a token string of the form {origin}_openapp_{secret}.
§Errors
Returns a TokenFormatError if the token is empty, lacks the separator, has an
empty secret, or if origin is not a bare absolute http(s) origin.
Sourcepub fn api_base_url(&self) -> Url
pub fn api_base_url(&self) -> Url
The versioned API root requests are resolved against: {origin}/api/v1.
Trait Implementations§
impl Eq for ApiKey
impl StructuralPartialEq for ApiKey
Auto Trait Implementations§
impl Freeze for ApiKey
impl RefUnwindSafe for ApiKey
impl Send for ApiKey
impl Sync for ApiKey
impl Unpin for ApiKey
impl UnsafeUnpin for ApiKey
impl UnwindSafe for ApiKey
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