use crate::cache::CacheConfig;
#[allow(clippy::return_self_not_must_use)]
#[derive(Clone, Debug)]
pub struct Configuration {
pub is_escaped_content: bool,
pub cache: CacheConfig,
pub function_recursion_depth: usize,
pub chunk_size: usize,
}
impl Default for Configuration {
fn default() -> Self {
Self {
is_escaped_content: true,
cache: CacheConfig::default(),
function_recursion_depth: 5,
chunk_size: 16384,
}
}
}
impl Configuration {
pub fn with_escaped(mut self, is_escaped: impl Into<bool>) -> Self {
self.is_escaped_content = is_escaped.into();
self
}
pub const fn with_caching(mut self, cache: CacheConfig) -> Self {
self.cache = cache;
self
}
pub const fn with_function_recursion_depth(mut self, depth: usize) -> Self {
self.function_recursion_depth = depth;
self
}
pub const fn with_chunk_size(mut self, chunk_size: usize) -> Self {
self.chunk_size = chunk_size;
self
}
}