pub enum MarginBoxContent {
None,
RunningElement(String),
NamedString(String),
PageCounter,
PagesCounter,
PageCounterFormatted {
format: CounterFormat,
},
Combined(Vec<MarginBoxContent>),
Text(String),
Custom(Arc<dyn Fn(PageInfo) -> String + Send + Sync>),
}Expand description
Content that can appear in a page margin box.
This enum represents the various types of content that CSS GCPM allows in margin boxes.
Variants§
None
Empty margin box
RunningElement(String)
A running element referenced by name: content: element(header)
NamedString(String)
A named string: content: string(chapter)
PageCounter
Page counter: content: counter(page)
PagesCounter
Total pages counter: content: counter(pages)
PageCounterFormatted
Page counter with format: content: counter(page, lower-roman)
Fields
§
format: CounterFormatCombined(Vec<MarginBoxContent>)
Combined content (e.g., “Page “ counter(page) “ of “ counter(pages))
Text(String)
Literal text
Custom(Arc<dyn Fn(PageInfo) -> String + Send + Sync>)
Custom callback for dynamic content generation
Trait Implementations§
Source§impl Clone for MarginBoxContent
impl Clone for MarginBoxContent
Source§fn clone(&self) -> MarginBoxContent
fn clone(&self) -> MarginBoxContent
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 MarginBoxContent
impl !RefUnwindSafe for MarginBoxContent
impl Send for MarginBoxContent
impl Sync for MarginBoxContent
impl Unpin for MarginBoxContent
impl UnsafeUnpin for MarginBoxContent
impl !UnwindSafe for MarginBoxContent
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<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