Skip to main content

Source

Trait Source 

Source
pub trait Source<'d> {
    type Body<'a>: Into<Ref<'a, 'd>>
       where Self: 'a,
             'd: 'a;

    // Required methods
    fn try_project<V, T>(
        &mut self,
        value: V,
        project: impl for<'a> FnOnce(V, View<'a, 'd>) -> T,
    ) -> Result<T, (V, Error)>;
    fn body<'a>(&'a self) -> Self::Body<'a>
       where 'd: 'a;
}
Expand description

Transport storage that can expose request-body projections without changing ownership.

Required Associated Types§

Source

type Body<'a>: Into<Ref<'a, 'd>>
where Self: 'a, 'd: 'a,

Required Methods§

Source

fn try_project<V, T>( &mut self, value: V, project: impl for<'a> FnOnce(V, View<'a, 'd>) -> T, ) -> Result<T, (V, Error)>

Source

fn body<'a>(&'a self) -> Self::Body<'a>
where 'd: 'a,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'d> Source<'d> for &[u8]

Source§

type Body<'a> = Ref<'a, 'd>
where Self: 'a, 'd: 'a,

Source§

fn try_project<V, T>( &mut self, value: V, project: impl for<'a> FnOnce(V, View<'a, 'd>) -> T, ) -> Result<T, (V, Error)>

Source§

fn body<'a>(&'a self) -> Self::Body<'a>
where 'd: 'a,

Implementors§

Source§

impl<'d> Source<'d> for Segments<'d>

Source§

type Body<'a> = &'a Segments<'d>
where Self: 'a, 'd: 'a,

Source§

impl<'req, 'd> Source<'d> for Ref<'req, 'd>

Source§

type Body<'a> = Ref<'a, 'd>
where Self: 'a, 'd: 'a,