Skip to main content

Parsed

Struct Parsed 

Source
pub struct Parsed<H, R: Schema> { /* private fields */ }
Expand description

A parsed schema bound to the immutable request that produced its fields.

Implementations§

Source§

impl<O: Source, F: Proof, R: Schema<Frame = F>> Parsed<Head<O, F>, R>

Source

pub unsafe fn try_bind( owner: O, layout: Layout, params: R::RawParams, headers: R::RawHeaders, ) -> Result<Self, BindError>

§Safety

layout must be valid for the exact bytes retained by owner, and both field sets must be produced by R from those bytes. Replacing the owner must preserve the complete head bytes and their offsets.

Source

pub const unsafe fn new( owner: Head<O, F>, params: R::RawParams, headers: R::RawHeaders, ) -> Self

§Safety

Both field sets must be produced by R from this exact head.

Source

pub fn borrow(&self) -> Parsed<Head<&[u8], F>, R>

Source§

impl<H, R: Schema> Parsed<H, R>

Source

pub const fn owner(&self) -> &H

Source

pub fn into_owner(self) -> H

Source

pub const fn params(&self) -> &R::RawParams

Source

pub const fn headers(&self) -> &R::RawHeaders

Source§

impl<F: Proof, R: Schema<Frame = F>> Parsed<Head<Bytes, F>, R>

Source

pub fn retain(self) -> Parsed<Head<Shared, F>, R>

Source§

impl<F: Proof, R: Schema<Frame = F>> Parsed<Head<Shared, F>, R>

Source

pub fn with_id<'d>(self, id: Id<'d>) -> Parsed<Parts<'d, F>, R>

Source§

impl<'d, F: Proof, R: Schema<Frame = F>> Parsed<Parts<'d, F>, R>

Source

pub fn with_body(self, body: Body<Segments<'d>>) -> Parsed<Retained<'d, F>, R>

Source§

impl<'d, F: Proof, R: Schema<Frame = F>> Parsed<Retained<'d, F>, R>

Source

pub fn into_parts(self) -> (Parsed<Parts<'d, F>, R>, Body<Segments<'d>>)

Source§

impl<F: Proof, R: Schema<Frame = F>> Parsed<Head<Bytes, F>, R>

Source

pub fn scope<T>( self, use_head: impl for<'id> FnOnce(Parsed<Head<Bytes<Owner<'id, Span<Plain<Layout>, Owned, Frozen>>>, F>, R>) -> T, ) -> T

Source§

impl<F: Proof, R: Schema<Frame = F>> Parsed<Head<Bytes<Owner<'_, Span<Plain<Layout>, Owned, Frozen>>>, F>, R>

Source

pub fn into_inner(self) -> Parsed<Head<Bytes, F>, R>

Auto Trait Implementations§

§

impl<H, R> Forget for Parsed<H, R>

§

impl<H, R> Freeze for Parsed<H, R>
where H: Freeze, <R as Schema>::RawParams: Freeze, <R as Schema>::RawHeaders: Freeze,

§

impl<H, R> RefUnwindSafe for Parsed<H, R>

§

impl<H, R> Send for Parsed<H, R>
where H: Send, <R as Schema>::RawParams: Send, <R as Schema>::RawHeaders: Send,

§

impl<H, R> Sync for Parsed<H, R>
where H: Sync, <R as Schema>::RawParams: Sync, <R as Schema>::RawHeaders: Sync,

§

impl<H, R> Unpin for Parsed<H, R>
where H: Unpin, <R as Schema>::RawParams: Unpin, <R as Schema>::RawHeaders: Unpin,

§

impl<H, R> UnsafeUnpin for Parsed<H, R>

§

impl<H, R> UnwindSafe for Parsed<H, R>

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> Convert<T> for T

Source§

fn into(self) -> T

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.