pub struct DirectRoute { /* private fields */ }Expand description
Carries a composable collection of endpoints and the selectors that reach them.
Implementations§
Source§impl DirectRoute
impl DirectRoute
Sourcepub fn labels(&self) -> Vec<String>
pub fn labels(&self) -> Vec<String>
Returns each composed selector as METHOD /path, in declaration order.
Sourcepub async fn answer(&self, request: DirectRequest) -> DirectResponse
pub async fn answer(&self, request: DirectRequest) -> DirectResponse
Answers a request by reaching the endpoint its method and path select.
Declaration order is the order candidates are read in, so a surface answers with the first endpoint that states it. A path that is declared under other methods is answered as such, rather than as nothing being there.
Trait Implementations§
Source§impl Clone for DirectRoute
impl Clone for DirectRoute
Source§fn clone(&self) -> DirectRoute
fn clone(&self) -> DirectRoute
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 moreSource§impl Default for DirectRoute
impl Default for DirectRoute
Source§fn default() -> DirectRoute
fn default() -> DirectRoute
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DirectRoute
impl !UnwindSafe for DirectRoute
impl Freeze for DirectRoute
impl Send for DirectRoute
impl Sync for DirectRoute
impl Unpin for DirectRoute
impl UnsafeUnpin for DirectRoute
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.