pub struct StaticFilesPlugin { /* private fields */ }Expand description
Process-wide StaticFilesPlugin singleton storing StaticFilesRuntime.
Implementations§
Source§impl StaticFilesPlugin
Inherent implementation of StaticFilesPlugin.
impl StaticFilesPlugin
Inherent implementation of StaticFilesPlugin.
Sourcepub fn init(config: StaticFilesConfig) -> Result<&'static Self, String>
pub fn init(config: StaticFilesConfig) -> Result<&'static Self, String>
Initializes the global StaticFilesPlugin once from config.
§Arguments
StaticFilesConfig- Static file server configuration.
§Returns
Result<&'static Self, String>- Global plugin reference or canonicalization error.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global StaticFilesPlugin, if initialized.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Sourcepub fn get_runtime(&self) -> &StaticFilesRuntime
pub fn get_runtime(&self) -> &StaticFilesRuntime
Trait Implementations§
Auto Trait Implementations§
impl Forget for StaticFilesPlugin
impl Freeze for StaticFilesPluginwhere
*const ArcInner<StaticFilesRuntimeInner> is !null: Freeze,
PhantomData<ArcInner<StaticFilesRuntimeInner>>: Freeze,
impl Move for StaticFilesPlugin
impl RefUnwindSafe for StaticFilesPluginwhere
Atomic<usize>: RefUnwindSafe,
RwLock<HashMap<String, Arc<CachedRouteEntry>, BuildHasherDefault<FxHasher>>>: RefUnwindSafe,
impl Send for StaticFilesPlugin
impl Sync for StaticFilesPlugin
impl Unpin for StaticFilesPlugin
impl UnsafeUnpin for StaticFilesPluginwhere
*const ArcInner<StaticFilesRuntimeInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<StaticFilesRuntimeInner>>: UnsafeUnpin,
impl UnwindSafe for StaticFilesPluginwhere
Arc<StaticFilesRuntimeInner>: UnwindSafe,
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