[−][src]Struct tide_naive_static_files::StaticFilesEndpoint
A struct that holds a path to your app's static assets directory. This
struct implements tide::Endpoint
so it can be passed directly to
tide::Route::get
.
The static assets will be served from the route provided to the app.at
. In
the example below, the file ./my-static-asset-dir/foo.html
would be
obtainable by making a GET request to
http://my.server.address/static/foo.html
.
use tide_naive_static_files::StaticFilesEndpoint; let mut app = tide::new(); app.at("/static").strip_prefix().get(StaticFilesEndpoint { root: "./my-static-asset-dir/".into(), });
Fields
root: PathBuf
Trait Implementations
impl<State> Endpoint<State> for StaticFilesEndpoint
[src]
Auto Trait Implementations
impl RefUnwindSafe for StaticFilesEndpoint
impl Send for StaticFilesEndpoint
impl Sync for StaticFilesEndpoint
impl Unpin for StaticFilesEndpoint
impl UnwindSafe for StaticFilesEndpoint
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<State, F, Fut> Endpoint<State> for F where
F: 'static + Send + Sync + Fn(Request<State>) -> Fut,
Fut: Future + Send + 'static,
<Fut as Future>::Output: IntoResponse,
[src]
F: 'static + Send + Sync + Fn(Request<State>) -> Fut,
Fut: Future + Send + 'static,
<Fut as Future>::Output: IntoResponse,
type Fut = Pin<Box<dyn Future<Output = Response> + 'static + Send>>
The async result of call
.
fn call(&self, req: Request<State>) -> <F as Endpoint<State>>::Fut
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,