pub struct Refusal { /* private fields */ }Expand description
A refusal of ReceiveAuth::authenticate or ReceiveAuth::open.
A refusal holds:
- the status, 401 or 403
- the message of its
unauthorizedframe - the response headers that it adds
Implementations§
Source§impl Refusal
impl Refusal
Creates a refusal with the status 401.
If message is longer than 4096 bytes, unauthorized cuts it to at
most 4096 bytes, at a character boundary.
Sourcepub fn forbidden(message: impl Into<String>) -> Refusal
pub fn forbidden(message: impl Into<String>) -> Refusal
Creates a refusal with the status 403.
If message is longer than 4096 bytes, forbidden cuts it to at most
4096 bytes, at a character boundary.
Sourcepub fn with_header(self, name: HeaderName, value: HeaderValue) -> Refusal
pub fn with_header(self, name: HeaderName, value: HeaderValue) -> Refusal
Returns the refusal with one more response header.
An example is a WWW-Authenticate header. The response holds the
headers in the order of the calls. If the host adds a name two times,
the response holds two headers.
The endpoint drops a header named Content-Length,
Transfer-Encoding, or Connection, because it sets the framing and
the connection state of the response itself.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusalwhere
NonZero<u16>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(HeaderName, HeaderValue)>: Freeze,
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusalwhere
NonZeroU16Inner: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(HeaderName, HeaderValue)>: UnsafeUnpin,
impl UnwindSafe for Refusalwhere
NonZero<u16>: UnwindSafe,
RawVecInner: UnwindSafe,
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: 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