pub struct StaticFilesRuntime { /* private fields */ }Expand description
Thread-safe static asset engine with 64-way sharded hot-file caching and security checks.
Implementations§
Source§impl StaticFilesRuntime
Inherent implementation of StaticFilesRuntime.
impl StaticFilesRuntime
Inherent implementation of StaticFilesRuntime.
Sourcepub fn new(config: StaticFilesConfig) -> Result<Self, String>
pub fn new(config: StaticFilesConfig) -> Result<Self, String>
Compiles a StaticFilesRuntime by canonicalizing config.root_dir.
§Arguments
StaticFilesConfig- Static file server configuration.
§Returns
Result<Self, String>- Ready runtime or canonicalization error message.
Sourcepub fn get_config(&self) -> &StaticFilesConfig
pub fn get_config(&self) -> &StaticFilesConfig
Sourcepub fn cached_bytes(&self) -> usize
pub fn cached_bytes(&self) -> usize
Returns current in-memory hot-file cache usage in bytes.
§Returns
usize- Cached bytes across all 64 shards.
Sourcepub async fn serve_context(&self, ctx: &mut Context) -> bool
pub async fn serve_context(&self, ctx: &mut Context) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Forget for StaticFilesRuntime
impl Freeze for StaticFilesRuntime
impl Move for StaticFilesRuntime
impl RefUnwindSafe for StaticFilesRuntime
impl Send for StaticFilesRuntime
impl Sync for StaticFilesRuntime
impl Unpin for StaticFilesRuntime
impl UnsafeUnpin for StaticFilesRuntime
impl UnwindSafe for StaticFilesRuntime
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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