Struct wick_config::config::TemplateConfig
source · pub struct TemplateConfig<V>where
V: Clone + Debug + Display + PartialEq + FromStr,{ /* private fields */ }Expand description
A liquid template configuration that retains portions of its context and can be unrendered into the original template or value.
Implementations§
source§impl<T> TemplateConfig<T>where
T: Clone + Debug + Display + PartialEq + FromStr,
impl<T> TemplateConfig<T>where T: Clone + Debug + Display + PartialEq + FromStr,
sourcepub const fn new_value(value: T) -> Self
pub const fn new_value(value: T) -> Self
Create a new TemplateConfig from a value.
sourcepub fn new_template(value: String) -> Self
pub fn new_template(value: String) -> Self
Create a new TemplateConfig from a template string.
sourcepub fn set_value(&mut self, value: T)
pub fn set_value(&mut self, value: T)
Set the value rendered held by this configuration to be cached.
sourcepub fn value_unchecked(&self) -> &T
pub fn value_unchecked(&self) -> &T
Retrieve the previously rendered value or panic.
This should only be used passed the boundary of configuration rendering.
sourcepub fn unrender(&self) -> Result<String, ManifestError>
pub fn unrender(&self) -> Result<String, ManifestError>
Return a TemplateConfig back to either its template or, if a template, does not exist, its value.
Trait Implementations§
source§impl<V> Clone for TemplateConfig<V>where
V: Clone + Debug + Display + PartialEq + FromStr + Clone,
impl<V> Clone for TemplateConfig<V>where V: Clone + Debug + Display + PartialEq + FromStr + Clone,
source§fn clone(&self) -> TemplateConfig<V>
fn clone(&self) -> TemplateConfig<V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<V> Debug for TemplateConfig<V>where
V: Clone + Debug + Display + PartialEq + FromStr + Debug,
impl<V> Debug for TemplateConfig<V>where V: Clone + Debug + Display + PartialEq + FromStr + Debug,
source§impl<T> Default for TemplateConfig<T>where
T: Clone + Debug + Display + PartialEq + FromStr + Default,
impl<T> Default for TemplateConfig<T>where T: Clone + Debug + Display + PartialEq + FromStr + Default,
source§impl<T> Hash for TemplateConfig<T>where
T: Clone + Debug + Display + PartialEq + FromStr + Hash,
impl<T> Hash for TemplateConfig<T>where T: Clone + Debug + Display + PartialEq + FromStr + Hash,
source§impl<V> PartialEq<TemplateConfig<V>> for TemplateConfig<V>where
V: Clone + Debug + Display + PartialEq + FromStr + PartialEq,
impl<V> PartialEq<TemplateConfig<V>> for TemplateConfig<V>where V: Clone + Debug + Display + PartialEq + FromStr + PartialEq,
source§fn eq(&self, other: &TemplateConfig<V>) -> bool
fn eq(&self, other: &TemplateConfig<V>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<V> Serialize for TemplateConfig<V>where
V: Clone + Debug + Display + PartialEq + FromStr,
impl<V> Serialize for TemplateConfig<V>where V: Clone + Debug + Display + PartialEq + FromStr,
impl<T> Eq for TemplateConfig<T>where T: Clone + Debug + Display + PartialEq + FromStr + Eq,
impl<V> StructuralPartialEq for TemplateConfig<V>where V: Clone + Debug + Display + PartialEq + FromStr,
Auto Trait Implementations§
impl<V> RefUnwindSafe for TemplateConfig<V>where V: RefUnwindSafe,
impl<V> Send for TemplateConfig<V>where V: Send,
impl<V> Sync for TemplateConfig<V>where V: Sync,
impl<V> Unpin for TemplateConfig<V>where V: Unpin,
impl<V> UnwindSafe for TemplateConfig<V>where V: 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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.