pub enum HttpMethod {
Get,
Post,
Put,
Patch,
Delete,
}Expand description
HTTP methods supported by http_call.
This crate does not implement http_call — the transport is supplied by the
service layer via AsyncFunctionHandler — so every consumer converts this
into their own HTTP client’s method type. HttpMethod::as_str is the
intended bridge (e.g. Method::from_bytes(m.as_str().as_bytes())); the crate
deliberately takes no HTTP-client dependency of its own.
Variants§
Implementations§
Source§impl HttpMethod
impl HttpMethod
Sourcepub const ALL: &'static [HttpMethod]
pub const ALL: &'static [HttpMethod]
Every method a workflow may name in an http_call task.
This is the vocabulary a service layer can validate its own operator-facing method allow-lists against, instead of mirroring the variant list by hand.
Scoped narrowly to http_call: this is not a general list of HTTP
methods, and should not be reused to validate, say, inbound route
definitions, which may legitimately accept HEAD or OPTIONS.
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Canonical uppercase token, identical to the spelling Deserialize
accepts — from_value(json!(m.as_str())) round-trips to m for every
variant.
Sourcepub const fn is_idempotent(&self) -> bool
pub const fn is_idempotent(&self) -> bool
Whether re-sending the request is safe (RFC 9110 idempotency), so a caller may retry a timeout without risking a duplicate side effect.
Written as an exhaustive match rather than a matches! so that adding
a variant is a compile error here rather than a silent classification as
non-idempotent.
Trait Implementations§
Source§impl Clone for HttpMethod
impl Clone for HttpMethod
Source§fn clone(&self) -> HttpMethod
fn clone(&self) -> HttpMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more