pub enum Source {
Path,
Query,
Form,
Header,
Claim,
Body,
Auto,
}Expand description
Where a request field’s value comes from.
Source::Auto is the absence of an explicit marker; the generated binder
then resolves it from the request method:
GET/HEAD/DELETE/OPTIONS— query string, then the route;POST/PUT/PATCH— JSON body, then form, then query string;multipart/form-data— form, then query string.
Headers and claims are never implicit: a header or token that happens to share a field name must not silently win.
Variants§
Path
A {name} segment of the route template.
Query
A query-string key (?name=value, repeatable).
Form
A multipart/form-data part (text or file).
Header
An HTTP header, looked up case-insensitively.
Claim
A claim from the authenticated principal.
Body
The JSON request body.
Auto
No marker: inferred from the request method.
Implementations§
Source§impl Source
impl Source
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The OpenAPI in value ("" for Source::Auto, resolved per route).
Sourcepub const fn is_explicit(self) -> bool
pub const fn is_explicit(self) -> bool
Whether an explicitly marked field must be present.
Trait Implementations§
impl Copy for Source
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Forget for Source
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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