pub enum SectionContent {
Static(&'static str),
Dynamic(Arc<dyn Fn() -> String + Send + Sync>),
Cached(String),
}Expand description
Section content type
Variants§
Static(&'static str)
Static content that can be cached
Dynamic(Arc<dyn Fn() -> String + Send + Sync>)
Dynamic content computed at runtime
Cached(String)
Cached result (computed once and stored)
Implementations§
Source§impl SectionContent
impl SectionContent
Sourcepub fn static_content(s: &'static str) -> Self
pub fn static_content(s: &'static str) -> Self
Create static content
Sourcepub fn is_cacheable(&self) -> bool
pub fn is_cacheable(&self) -> bool
Check if this content can be cached
Trait Implementations§
Source§impl Clone for SectionContent
impl Clone for SectionContent
Source§fn clone(&self) -> SectionContent
fn clone(&self) -> SectionContent
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 moreAuto Trait Implementations§
impl Freeze for SectionContent
impl !RefUnwindSafe for SectionContent
impl Send for SectionContent
impl Sync for SectionContent
impl Unpin for SectionContent
impl UnsafeUnpin for SectionContent
impl !UnwindSafe for SectionContent
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