Struct SerdeBodyParser

Source
pub struct SerdeBodyParser<R: Resource + Deserialize> { /* private fields */ }
Expand description

A Gneric Body parser using the serde functionality (and Json serialisation)

Implementations§

Source§

impl<R> SerdeBodyParser<R>
where R: Resource + Send + Sync + Any + Deserialize,

Source

pub fn new() -> SerdeBodyParser<R>

create a new parser

Trait Implementations§

Source§

impl<R> Key for SerdeBodyParser<R>
where R: Resource + Send + Sync + Any + Deserialize,

Source§

type Value = R

The value type associated with this key type.
Source§

impl<R> ParserMiddleware for SerdeBodyParser<R>
where R: Resource + Send + Sync + Any + Deserialize,

Source§

fn parse(&self, req: &mut Request<'_, '_>) -> IronResult<Self::Value>

called befor handing a endpoint with a Body/Options not that the id in the url is expected to be percent_encoded and will be decoded to utf-8 before being passed to parse. Illegal UTF-8 encodings will be replaced with U+FFFD (see url::percent_encoding::lossy_utf8_percent_decode) NOTE: in future version lossy decoding might be replaced with a more strict decoding Never relay on the fact thats lossy decoded
Source§

impl<R> BodyParser<R> for SerdeBodyParser<R>
where R: Resource + Send + Sync + Any + Deserialize,

Auto Trait Implementations§

§

impl<R> Freeze for SerdeBodyParser<R>

§

impl<R> RefUnwindSafe for SerdeBodyParser<R>
where R: RefUnwindSafe,

§

impl<R> Send for SerdeBodyParser<R>
where R: Send,

§

impl<R> Sync for SerdeBodyParser<R>
where R: Sync,

§

impl<R> Unpin for SerdeBodyParser<R>
where R: Unpin,

§

impl<R> UnwindSafe for SerdeBodyParser<R>
where R: UnwindSafe,

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, 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> PersistentInto<Arc<Mutex<T>>> for T

Source§

fn persistent_into(self) -> Arc<Mutex<T>>

Convert self into a value of type T.
Source§

impl<T> PersistentInto<Arc<RwLock<T>>> for T

Source§

fn persistent_into(self) -> Arc<RwLock<T>>

Convert self into a value of type T.
Source§

impl<T> PersistentInto<Arc<T>> for T

Source§

fn persistent_into(self) -> Arc<T>

Convert self into a value of type T.
Source§

impl<T> PersistentInto<T> for T

Source§

fn persistent_into(self) -> T

Convert self into a value of type T.
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> Typeable for T
where T: Any,

Source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
Source§

impl<T> UnsafeAny for T
where T: Any,