pub enum Method {
List,
Get,
Delete,
Post,
Patch,
Listen,
Action(String),
}
Expand description
A type of request, for instance “List” or “Post”.
These mostly correspond to the HTTP methods, with the addition of List
, Listen
, and Action
.
List
is aGET
request with an ID on a resource, such asGET /cats
.Listen
is aGET
request with aAccept: text/event-stream
header.Listen
requests may or may not have IDs, so bothGET /cats
andGET /cats/123
with theevent-stream
header would be aListen
request.Action
is a custom action on a specific resource ID. For instance,POST /cats/123/feed
would beAction("feed")
.
Note that we don’t support PUT
requests currently, for simplicity.
Variants§
List
GET /resource
, indempotent
Get
GET /resource/123
, indempotent
Delete
DELETE /resource/123
, indempotent
Post
POST /resource
Patch
PATCH /resource/123
Listen
Either GET /resource/
or GET /resource/123
, with the Accept: text/event-stream
header
Action(String)
POST /resource/123/actionname
Implementations§
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 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