Skip to main content

ExtractedParams

Struct ExtractedParams 

Source
pub struct ExtractedParams { /* private fields */ }
Expand description

Parameters extracted after route resolution — path captures plus the declared query and body values. The #[controller] macro reads typed handler arguments out of this; application code rarely touches it directly.

Implementations§

Source§

impl ExtractedParams

Source

pub fn get_string(&self, name: &str) -> Result<String, WebError>

The value of path/query parameter name as a String; 400 if absent.

Source

pub fn get_i64(&self, name: &str) -> Result<i64, WebError>

Parse path/query parameter name as an i64; 400 if missing or unparsable.

Source

pub fn get_u64(&self, name: &str) -> Result<u64, WebError>

Parse path/query parameter name as a u64; 400 if missing or unparsable.

Source

pub fn get_u32(&self, name: &str) -> Result<u32, WebError>

Parse path/query parameter name as a u32; 400 if missing or unparsable.

Source

pub fn get_f64(&self, name: &str) -> Result<f64, WebError>

Parse path/query parameter name as an f64; 400 if missing or unparsable.

Source

pub fn get_bool(&self, name: &str) -> Result<bool, WebError>

Read path/query parameter name as a bool — false when absent, empty, "false", or "0"; true otherwise.

Source

pub fn get_string_array(&self, name: &str) -> Result<Vec<String>, WebError>

All values for name (in request order; empty if the name wasn’t present). Backs Vec<String> handler parameters — a one-element list (?tags=a) and a many-element one (?tags=a&tags=b) flow through the same path.

Source

pub fn get_json_body(&self) -> Result<JsonValue, WebError>

The parsed JSON request body, or 400 Bad Request if there wasn’t one.

Source

pub fn get_body_bytes(&self) -> Bytes

Raw bytes of the request body. See Params::body_bytes for the content-type-aware semantics. Used by the macro to extract a Bytes handler argument.

Trait Implementations§

Source§

impl Debug for ExtractedParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more