pub struct StaticResourceController;Implementations§
Source§impl StaticResourceController
impl StaticResourceController
pub fn is_matching_request(request: &Request) -> bool
pub fn process_request(request: &Request, response: Response) -> Response
pub fn process_static_resources( request: &Request, ) -> Result<Vec<ContentRange>, Error>
Source§impl StaticResourceController
Directory listing generation — used by StaticResourceController whenever a
requested directory has no index.html. Self-contained HTML (inline CSS/JS, no
external requests), dark/light adaptive via prefers-color-scheme.
impl StaticResourceController
Directory listing generation — used by StaticResourceController whenever a
requested directory has no index.html. Self-contained HTML (inline CSS/JS, no
external requests), dark/light adaptive via prefers-color-scheme.
Sourcepub fn render_directory_listing(fs_dir_path: &str, request_path: &str) -> String
pub fn render_directory_listing(fs_dir_path: &str, request_path: &str) -> String
Renders a directory listing page for fs_dir_path (absolute filesystem path)
requested at request_path (the URL path, used to build links and breadcrumbs).
Hidden entries (dotfiles) are omitted. Directories sort before files;
each group is sorted case-insensitively by name.
Trait Implementations§
Source§impl Controller for StaticResourceController
impl Controller for StaticResourceController
Source§fn is_matching(request: &Request, _connection: &ConnectionInfo) -> bool
fn is_matching(request: &Request, _connection: &ConnectionInfo) -> bool
Returns
true if this controller should handle the given request.
Called in declaration order; the first match wins.Auto Trait Implementations§
impl Freeze for StaticResourceController
impl RefUnwindSafe for StaticResourceController
impl Send for StaticResourceController
impl Sync for StaticResourceController
impl Unpin for StaticResourceController
impl UnsafeUnpin for StaticResourceController
impl UnwindSafe for StaticResourceController
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