pub struct HyperRoute { /* private fields */ }Expand description
Serves one compiled surface over hyper.
The surface does the routing and the reading; this states only how a hyper request becomes one a surface answers, and how that answer becomes a hyper response.
Implementations§
Source§impl HyperRoute
impl HyperRoute
Sourcepub fn new(surface: DirectRoute) -> Self
pub fn new(surface: DirectRoute) -> Self
Constructs a new HyperRoute.
Source§impl HyperRoute
impl HyperRoute
Sourcepub const fn reading(self, bytes: usize) -> Self
pub const fn reading(self, bytes: usize) -> Self
Reads a request body of at most bytes, answering 413 for one larger than that.
What a service accepts is the service’s to state. The default is a sane bound rather than a policy, so anything serving callers it does not control states its own.
Sourcepub async fn answer<Sent>(&self, request: Request<Sent>) -> HyperAnswer
pub async fn answer<Sent>(&self, request: Request<Sent>) -> HyperAnswer
Answers one request, whatever carried it here.
A request that cannot be read is answered rather than dropped, because a caller that sent something unreadable is still owed an answer.
Trait Implementations§
Source§impl Clone for HyperRoute
impl Clone for HyperRoute
Source§fn clone(&self) -> HyperRoute
fn clone(&self) -> HyperRoute
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HyperRoute
impl !UnwindSafe for HyperRoute
impl Freeze for HyperRoute
impl Send for HyperRoute
impl Sync for HyperRoute
impl Unpin for HyperRoute
impl UnsafeUnpin for HyperRoute
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<This> HttpProgramExt<This> for This
impl<This> HttpProgramExt<This> for This
Source§fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
Compiles a named HTTP program with this interpreter.