pub struct Silo { /* private fields */ }Expand description
Represents a root directory, which may be embedded or dynamic.
Implementations§
Source§impl Silo
impl Silo
Sourcepub const fn from_embedded(
phf_map: &'static Map<&'static str, EmbedEntry>,
root: &'static str,
) -> Self
pub const fn from_embedded( phf_map: &'static Map<&'static str, EmbedEntry>, root: &'static str, ) -> Self
Create a Silo from an EmbedSilo.
Sourcepub const fn from_path(path: &'static str) -> Self
pub const fn from_path(path: &'static str) -> Self
Create a Silo from a static path (dynamic root).
Sourcepub fn into_dynamic(self) -> Self
pub fn into_dynamic(self) -> Self
Convert to a dynamic Silo if currently embedded, otherwise returns self.
Sourcepub fn auto_dynamic(self) -> Self
pub fn auto_dynamic(self) -> Self
Automatically converts to a dynamic directory if in debug mode (cfg!(debug_assertions)). In release mode, returns self unchanged. Convert to a dynamic Silo in debug mode, otherwise returns self.
Sourcepub fn is_dynamic(&self) -> bool
pub fn is_dynamic(&self) -> bool
Returns true if this Silo is dynamic (filesystem-backed).
Sourcepub fn is_embedded(&self) -> bool
pub fn is_embedded(&self) -> bool
Returns true if this Silo is embedded in the binary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Silo
impl RefUnwindSafe for Silo
impl Send for Silo
impl Sync for Silo
impl Unpin for Silo
impl UnwindSafe for Silo
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