pub enum Method {
ReqMod,
RespMod,
Options,
}Expand description
ICAP protocol methods recognized by the server/router.
Defined by RFC 3507. In this crate:
OPTIONSis answered automatically by the server (capabilities discovery);
§Methods
- REQMOD — Request modification: the ICAP client (usually a proxy) sends an embedded HTTP request to be adapted.
- RESPMOD — Response modification: the ICAP client sends an embedded HTTP response to be adapted.
- OPTIONS — Capability discovery: clients learn which methods and
features a service supports. Handled automatically by the server; do
not register a handler for
OPTIONS.
§Conversions
Method implements From<&str> / From<String> so you can pass
strings in a builder-style API. Passing an unknown string will panic.
Variants§
ReqMod
Request modification (REQMOD).
RespMod
Response modification (RESPMOD).
Options
Capability discovery (OPTIONS).
Implementations§
Source§impl Method
impl Method
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Returns the canonical ICAP token for this method.
Always uppercase: "REQMOD", "RESPMOD", or "OPTIONS".
Sourcepub fn parse_token(token: &str) -> IcapResult<Self>
pub fn parse_token(token: &str) -> IcapResult<Self>
Parse an ICAP method token into a structured Method.
This is the non-panicking counterpart to Method::from(&str).
Trait Implementations§
impl Copy for Method
impl Eq for Method
Source§impl Ord for Method
impl Ord for Method
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Method
impl PartialOrd for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnsafeUnpin for Method
impl UnwindSafe for Method
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