pub enum Classification {
FromHeaders(ClassifiedCall),
FromBody,
}Expand description
The outcome of looking at the request headers alone.
Variants§
FromHeaders(ClassifiedCall)
The revision mandates header/body validation, so the headers priced the call and the body is never parsed.
FromBody
A legacy revision. The call is priced from the body once it has been read.
Implementations§
Source§impl Classification
impl Classification
Sourcepub const fn is_from_body(&self) -> bool
pub const fn is_from_body(&self) -> bool
Whether the call was priced from the body rather than from trusted headers.
Sourcepub fn resolve(
self,
http_method: &Method,
body: &[u8],
) -> Result<Option<ClassifiedCall>, String>
pub fn resolve( self, http_method: &Method, body: &[u8], ) -> Result<Option<ClassifiedCall>, String>
Finish classification, reading the body only when the headers could not be
trusted. Called after the credential gate.
Transport operations and valid client responses return None.
§Errors
Returns an error when the legacy body cannot be classified safely.
Trait Implementations§
Source§impl Clone for Classification
impl Clone for Classification
Auto Trait Implementations§
impl Freeze for Classification
impl RefUnwindSafe for Classification
impl Send for Classification
impl Sync for Classification
impl Unpin for Classification
impl UnsafeUnpin for Classification
impl UnwindSafe for Classification
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