pub struct Config {
pub data: ConfigData,
/* private fields */
}Expand description
Main configuration structure with embedded Lua state
Fields§
§data: ConfigDataImplementations§
Source§impl Config
impl Config
Sourcepub fn call_computed(&self, name: &str, sections_json: &str) -> Result<Value>
pub fn call_computed(&self, name: &str, sections_json: &str) -> Result<Value>
Call a computed function with sections data
Sourcepub fn has_sort_fn(&self, section_name: &str) -> bool
pub fn has_sort_fn(&self, section_name: &str) -> bool
Check if a section has a custom sort function
Sourcepub fn call_sort_fn(
&self,
section_name: &str,
a_json: &Value,
b_json: &Value,
) -> Result<Ordering>
pub fn call_sort_fn( &self, section_name: &str, a_json: &Value, b_json: &Value, ) -> Result<Ordering>
Call the sort function for a section (C-style comparator: returns -1, 0, 1)
Sourcepub fn computed_names(&self) -> Vec<&str>
pub fn computed_names(&self) -> Vec<&str>
Get all computed function names
Sourcepub fn filter_names(&self) -> Vec<&str>
pub fn filter_names(&self) -> Vec<&str>
Get all filter function names
Sourcepub fn has_computed_pages(&self) -> bool
pub fn has_computed_pages(&self) -> bool
Check if computed_pages function exists
Sourcepub fn call_before_build(&self) -> Result<()>
pub fn call_before_build(&self) -> Result<()>
Call before_build hook
Sourcepub fn call_after_build(&self) -> Result<()>
pub fn call_after_build(&self) -> Result<()>
Call after_build hook
Sourcepub fn call_filter(&self, name: &str, value: &str) -> Result<String>
pub fn call_filter(&self, name: &str, value: &str) -> Result<String>
Call a filter function with a value
Sourcepub fn call_function(&self, name: &str, args: Vec<Value>) -> Result<Value>
pub fn call_function(&self, name: &str, args: Vec<Value>) -> Result<Value>
Call a custom template function
Sourcepub fn function_names(&self) -> Vec<&str>
pub fn function_names(&self) -> Vec<&str>
Get all custom function names
Sourcepub fn call_computed_pages(
&self,
sections_json: &str,
) -> Result<Vec<ComputedPage>>
pub fn call_computed_pages( &self, sections_json: &str, ) -> Result<Vec<ComputedPage>>
Call computed_pages function to generate dynamic pages
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more