pub struct FilesService {
pub path: PathBuf,
}Expand description
Hosts a directory with static files
Fields§
§path: PathBufImplementations§
Source§impl FilesService
impl FilesService
pub fn new(path: impl Into<PathBuf>) -> FilesService
Trait Implementations§
Source§impl HttpService for FilesService
impl HttpService for FilesService
Source§async fn request(
&self,
route: &str,
req: &HttpRequest,
_body: &mut dyn HttpRead,
) -> HttpResult
async fn request( &self, route: &str, req: &HttpRequest, _body: &mut dyn HttpRead, ) -> HttpResult
Serve the request Read more
Source§fn filter(&self, _route: &str, req: &HttpRequest) -> HttpResult<()>
fn filter(&self, _route: &str, req: &HttpRequest) -> HttpResult<()>
Checks if request is valid Read more
Auto Trait Implementations§
impl Freeze for FilesService
impl RefUnwindSafe for FilesService
impl Send for FilesService
impl Sync for FilesService
impl Unpin for FilesService
impl UnwindSafe for FilesService
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> HttpServiceRaw for Twhere
T: HttpService,
impl<T> HttpServiceRaw for Twhere
T: HttpService,
Source§fn request_raw<'a>(
&'a self,
route: &'a str,
req: &'a HttpRequest,
body: &'a mut dyn HttpRead,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Box<dyn HttpError>>> + Send + 'a>>
fn request_raw<'a>( &'a self, route: &'a str, req: &'a HttpRequest, body: &'a mut dyn HttpRead, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Box<dyn HttpError>>> + Send + 'a>>
Serve the request (dyn version)
Source§fn filter_raw(
&self,
route: &str,
req: &HttpRequest,
) -> Result<(), Box<dyn HttpError>>
fn filter_raw( &self, route: &str, req: &HttpRequest, ) -> Result<(), Box<dyn HttpError>>
Checks if request is valid (dyn version)