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.
Listis aGETrequest with an ID on a resource, such asGET /cats.Listenis aGETrequest with aAccept: text/event-streamheader.Listenrequests may or may not have IDs, so bothGET /catsandGET /cats/123with theevent-streamheader would be aListenrequest.Actionis a custom action on a specific resource ID. For instance,POST /cats/123/feedwould 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 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