pub struct TemplateRenderer<L> {
pub path: &'static str,
/* private fields */
}Expand description
Gets some data via the provided <L: DataLoader> and renders it to the template provided in the Self::path field.
Fields§
§path: &'static strImplementations§
Trait Implementations§
Source§impl<L: Clone> Clone for TemplateRenderer<L>
impl<L: Clone> Clone for TemplateRenderer<L>
Source§fn clone(&self) -> TemplateRenderer<L>
fn clone(&self) -> TemplateRenderer<L>
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<L: Debug> Debug for TemplateRenderer<L>
impl<L: Debug> Debug for TemplateRenderer<L>
Source§impl<S, L> From<TemplateRenderer<L>> for MethodRouter<S>where
Self: Send,
S: Clone + Send + Sync + 'static + ProvideState<Templating> + ProvideState<L>,
L: DataLoader<S> + Clone + Send + Sync + 'static,
<L as DataLoader<S>>::Args: Send,
<<L as DataLoader<S>>::Args as FromRequestParts<S>>::Rejection: Send,
impl<S, L> From<TemplateRenderer<L>> for MethodRouter<S>where
Self: Send,
S: Clone + Send + Sync + 'static + ProvideState<Templating> + ProvideState<L>,
L: DataLoader<S> + Clone + Send + Sync + 'static,
<L as DataLoader<S>>::Args: Send,
<<L as DataLoader<S>>::Args as FromRequestParts<S>>::Rejection: Send,
Source§fn from(val: TemplateRenderer<L>) -> Self
fn from(val: TemplateRenderer<L>) -> Self
Converts to this type from the input type.
Source§impl<T, S, L> Handler<T, S> for TemplateRenderer<L>where
Self: Send,
T: 'static,
S: Clone + Send + Sync + 'static + ProvideState<Templating> + ProvideState<L>,
L: DataLoader<S> + Clone + Send + Sync + 'static,
<L as DataLoader<S>>::Args: Send,
<<L as DataLoader<S>>::Args as FromRequestParts<S>>::Rejection: Send,
impl<T, S, L> Handler<T, S> for TemplateRenderer<L>where
Self: Send,
T: 'static,
S: Clone + Send + Sync + 'static + ProvideState<Templating> + ProvideState<L>,
L: DataLoader<S> + Clone + Send + Sync + 'static,
<L as DataLoader<S>>::Args: Send,
<<L as DataLoader<S>>::Args as FromRequestParts<S>>::Rejection: Send,
Source§type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>
type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>
The type of future calling this handler returns.
Source§fn call(self, request: Request, state: S) -> Self::Future
fn call(self, request: Request, state: S) -> Self::Future
Call the handler with the given request.
Source§fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
Apply a
tower::Layer to the handler. Read moreSource§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Convert the handler into a
Service by providing the stateAuto Trait Implementations§
impl<L> Freeze for TemplateRenderer<L>
impl<L> RefUnwindSafe for TemplateRenderer<L>where
L: RefUnwindSafe,
impl<L> Send for TemplateRenderer<L>where
L: Send,
impl<L> Sync for TemplateRenderer<L>where
L: Sync,
impl<L> Unpin for TemplateRenderer<L>where
L: Unpin,
impl<L> UnsafeUnpin for TemplateRenderer<L>
impl<L> UnwindSafe for TemplateRenderer<L>where
L: UnwindSafe,
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