Struct poem::endpoint::StaticFileEndpoint
source · [−]pub struct StaticFileEndpoint { /* private fields */ }
This is supported on crate feature
static-files
only.Expand description
Implementations
Create new single static file service for a specified file path.
Example
use poem::{endpoint::StaticFileEndpoint, Route};
let app = Route::new().at("/logo.png", StaticFileEndpoint::new("/etc/logo.png"));
Specifies whether text responses should signal a UTF-8 encoding.
Default is true
.
Trait Implementations
Get the response to the request.
Auto Trait Implementations
impl RefUnwindSafe for StaticFileEndpoint
impl Send for StaticFileEndpoint
impl Sync for StaticFileEndpoint
impl Unpin for StaticFileEndpoint
impl UnwindSafe for StaticFileEndpoint
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more