#[repr(u8)]pub enum RpcMethod {
Get = 1,
Post = 2,
Put = 3,
Delete = 4,
Patch = 5,
}Expand description
HTTP method tag, encoded as a single byte on the wire.
Values are explicit and MUST NOT be renumbered: a renumber would silently reroute a POST into a GET handler on the far side.
Variants§
Implementations§
Source§impl RpcMethod
impl RpcMethod
Sourcepub fn from_u8(v: u8) -> Option<Self>
pub fn from_u8(v: u8) -> Option<Self>
Parse a method byte. Unknown values return None so a reader drops
the frame instead of guessing.
Sourcepub fn from_http_method(method: &str) -> Option<Self>
pub fn from_http_method(method: &str) -> Option<Self>
Parse an HTTP method name. None for a method the relay does not carry.
Sourcepub fn as_http_method(&self) -> &'static str
pub fn as_http_method(&self) -> &'static str
The HTTP method string, for a proxy that re-emits the request.
Trait Implementations§
impl Copy for RpcMethod
impl Eq for RpcMethod
impl StructuralPartialEq for RpcMethod
Auto Trait Implementations§
impl Freeze for RpcMethod
impl RefUnwindSafe for RpcMethod
impl Send for RpcMethod
impl Sync for RpcMethod
impl Unpin for RpcMethod
impl UnsafeUnpin for RpcMethod
impl UnwindSafe for RpcMethod
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.