pub struct Config { /* private fields */ }Expand description
Validated renderer configuration.
Build one with Config::builder, Config::from_env, or Config::default. Every
constructor validates its limits, so a Config is always usable.
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder() -> ConfigBuilder
pub fn builder() -> ConfigBuilder
Start a builder with conservative defaults.
Sourcepub fn from_env() -> Result<Self, ConfigError>
pub fn from_env() -> Result<Self, ConfigError>
Read SWORD_VIEWS, SWORD_CACHE_CAPACITY and SWORD_ENVIRONMENT once, at application startup.
Unset variables keep the defaults. Do not call this on a request path; use
ConfigBuilder::from_env to override the result programmatically.
Sourcepub fn cache_capacity(&self) -> usize
pub fn cache_capacity(&self) -> usize
Maximum number of cached templates; zero disables the cache.
Sourcepub fn environment(&self) -> &str
pub fn environment(&self) -> &str
The application environment @env and @production compare against. Under the
Laravel adapter the framework’s own environment is used instead.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Configwhere
RawVecInner: Send,
impl Sync for Configwhere
RawVecInner: Sync,
impl Unpin for Config
impl UnsafeUnpin for Configwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for Configwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.