pub struct Method(/* private fields */);Expand description
A case-sensitive HTTP method token. Unknown methods remain representable.
Implementations§
Source§impl Method
impl Method
pub const GET: Self
pub const HEAD: Self
pub const POST: Self
pub const PUT: Self
pub const DELETE: Self
pub const CONNECT: Self
pub const OPTIONS: Self
pub const TRACE: Self
pub const PATCH: Self
pub const QUERY: Self
pub fn new(value: impl Into<String>) -> Result<Self, InvalidMethod>
pub fn as_str(&self) -> &str
Sourcepub fn is_safe(&self) -> bool
pub fn is_safe(&self) -> bool
Semantic safety does not imply that an attempted exchange can be retried.
Sourcepub fn is_idempotent(&self) -> bool
pub fn is_idempotent(&self) -> bool
Method semantics only; processing state and body replay are separate. Unknown extension methods conservatively return false.
Trait Implementations§
impl Eq 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