#[non_exhaustive]pub struct Header {
pub metadata: BlockMetadata,
pub title: Title,
pub subtitle: Option<Subtitle>,
pub authors: Vec<Author>,
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§title: Title§subtitle: Option<Subtitle>§location: LocationImplementations§
Source§impl Header
impl Header
Sourcepub fn new(title: Title, location: Location) -> Self
pub fn new(title: Title, location: Location) -> Self
Create a new header with the given title and location.
Sourcepub fn with_metadata(self, metadata: BlockMetadata) -> Self
pub fn with_metadata(self, metadata: BlockMetadata) -> Self
Set the metadata.
Sourcepub fn with_subtitle(self, subtitle: Subtitle) -> Self
pub fn with_subtitle(self, subtitle: Subtitle) -> Self
Set the subtitle.
Set the authors.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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