pub struct PublicConfig {
pub enabled: bool,
pub dir: String,
pub not_found: Option<String>,
}Expand description
Static files served from the app’s public/ directory.
When the directory exists its contents are served at the site root, so
public/index.html answers / and public/style.css answers /style.css.
Fields§
§enabled: boolServe dir at the root when it exists (default true).
dir: StringDirectory (relative to the app root) holding the static site.
not_found: Option<String>Page returned for requests that match nothing, relative to dir.
Defaults to 404.html when that file exists.
Trait Implementations§
Source§impl Clone for PublicConfig
impl Clone for PublicConfig
Source§fn clone(&self) -> PublicConfig
fn clone(&self) -> PublicConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PublicConfig
impl Debug for PublicConfig
Source§impl Default for PublicConfig
impl Default for PublicConfig
Source§impl<'de> Deserialize<'de> for PublicConfigwhere
PublicConfig: Default,
impl<'de> Deserialize<'de> for PublicConfigwhere
PublicConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PublicConfig
impl RefUnwindSafe for PublicConfig
impl Send for PublicConfig
impl Sync for PublicConfig
impl Unpin for PublicConfig
impl UnsafeUnpin for PublicConfig
impl UnwindSafe for PublicConfig
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