#[non_exhaustive]pub struct Header<'a> {
pub metadata: BlockMetadata<'a>,
pub title: Title<'a>,
pub subtitle: Option<Subtitle<'a>>,
pub authors: Vec<Author<'a>>,
pub location: Location,
}Expand description
A Header represents the header of a document.
The header contains the title, subtitle, authors, and optional metadata (such as ID and roles) that can be applied to the document title.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.metadata: BlockMetadata<'a>§title: Title<'a>§subtitle: Option<Subtitle<'a>>§location: LocationImplementations§
Source§impl<'a> Header<'a>
impl<'a> Header<'a>
Sourcepub fn new(title: Title<'a>, location: Location) -> Self
pub fn new(title: Title<'a>, location: Location) -> Self
Create a new header with the given title and location.
Sourcepub fn with_metadata(self, metadata: BlockMetadata<'a>) -> Self
pub fn with_metadata(self, metadata: BlockMetadata<'a>) -> Self
Set the metadata.
Sourcepub fn with_subtitle(self, subtitle: Subtitle<'a>) -> Self
pub fn with_subtitle(self, subtitle: Subtitle<'a>) -> Self
Set the subtitle.
Set the authors.
Trait Implementations§
impl<'a> StructuralPartialEq for Header<'a>
Auto Trait Implementations§
impl<'a> Freeze for Header<'a>
impl<'a> RefUnwindSafe for Header<'a>
impl<'a> Send for Header<'a>
impl<'a> Sync for Header<'a>
impl<'a> Unpin for Header<'a>
impl<'a> UnsafeUnpin for Header<'a>
impl<'a> UnwindSafe for Header<'a>
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