pub struct MutationAuthority(/* private fields */);Expand description
Validated mutation authority required by every published router and serve
constructor. Keeping the unauthenticated state unrepresentable prevents an
embedder from accidentally exposing money-spending POST /api/... routes.
Implementations§
Source§impl MutationAuthority
impl MutationAuthority
Sourcepub fn new(token: impl Into<String>) -> Result<Self, InvalidMutationAuthority>
pub fn new(token: impl Into<String>) -> Result<Self, InvalidMutationAuthority>
Validate a token for transport in TOKEN_HEADER. Tokens are opaque,
but must be non-empty visible ASCII with no whitespace or control
characters so every HTTP client presents the same bytes.
Trait Implementations§
Source§impl Clone for MutationAuthority
impl Clone for MutationAuthority
Source§impl Debug for MutationAuthority
impl Debug for MutationAuthority
impl Eq for MutationAuthority
Source§impl PartialEq for MutationAuthority
impl PartialEq for MutationAuthority
impl StructuralPartialEq for MutationAuthority
Auto Trait Implementations§
impl Freeze for MutationAuthority
impl RefUnwindSafe for MutationAuthority
impl Send for MutationAuthority
impl Sync for MutationAuthority
impl Unpin for MutationAuthority
impl UnsafeUnpin for MutationAuthority
impl UnwindSafe for MutationAuthority
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