pub struct MetadataSheet {Show 15 fields
pub contributor: Vec<String>,
pub creator: Vec<String>,
pub date: HashMap<String, String>,
pub identifier: HashMap<String, String>,
pub language: Vec<String>,
pub relation: Vec<String>,
pub subject: Vec<String>,
pub title: Vec<String>,
pub coverage: String,
pub description: String,
pub format: String,
pub publisher: String,
pub rights: String,
pub source: String,
pub epub_type: String,
}Expand description
A unified metadata sheet for EPUB publications
This struct provides a simplified, high-level interface for accessing EPUB metadata. It consolidates metadata from both EPUB 2 and EPUB 3 specifications into a single convenient structure, with separate storage for multi-value fields and single-value fields.
Fields§
§contributor: Vec<String>Contributors to the publication (e.g., editors, translators)
creator: Vec<String>Primary creators/authors of the publication
date: HashMap<String, String>Date information with optional event types (e.g., publication, creation)
identifier: HashMap<String, String>Unique identifiers with their assigned IDs as keys
language: Vec<String>Language codes for the publication content
relation: Vec<String>References to related resources
subject: Vec<String>Subject keywords or topics
title: Vec<String>Title(s) of the publication
coverage: StringSpatial or temporal coverage of the publication
description: StringDescription or abstract of the publication
format: StringPhysical or digital format of the publication
publisher: StringPublisher information
rights: StringCopyright and licensing rights
source: StringReference to the source publication
epub_type: StringEPUB-specific type identifier
Implementations§
Source§impl MetadataSheet
impl MetadataSheet
Source§impl MetadataSheet
impl MetadataSheet
Sourcepub fn append_contributor(
&mut self,
contributor: impl Into<String>,
) -> &mut Self
pub fn append_contributor( &mut self, contributor: impl Into<String>, ) -> &mut Self
Appends a contributor to the metadata
Sourcepub fn append_creator(&mut self, creator: impl Into<String>) -> &mut Self
pub fn append_creator(&mut self, creator: impl Into<String>) -> &mut Self
Appends a creator to the metadata
Sourcepub fn append_language(&mut self, language: impl Into<String>) -> &mut Self
pub fn append_language(&mut self, language: impl Into<String>) -> &mut Self
Appends a language to the metadata
Sourcepub fn append_relation(&mut self, relation: impl Into<String>) -> &mut Self
pub fn append_relation(&mut self, relation: impl Into<String>) -> &mut Self
Appends a relation to the metadata
Sourcepub fn append_subject(&mut self, subject: impl Into<String>) -> &mut Self
pub fn append_subject(&mut self, subject: impl Into<String>) -> &mut Self
Appends a subject to the metadata
Sourcepub fn append_title(&mut self, title: impl Into<String>) -> &mut Self
pub fn append_title(&mut self, title: impl Into<String>) -> &mut Self
Appends a title to the metadata
Sourcepub fn append_date(
&mut self,
date: impl Into<String>,
event: impl Into<String>,
) -> &mut Self
pub fn append_date( &mut self, date: impl Into<String>, event: impl Into<String>, ) -> &mut Self
Sets a date value with optional event type
Parameters:
date: The date value (used as key to allow multiple dates)event: Optional event type (e.g., “publication”, “creation”, “modification”)
Note: Multiple dates can be stored. The date string is used as the key, and the event type (if any) is stored as the value.
Sourcepub fn append_identifier(
&mut self,
id: impl Into<String>,
value: impl Into<String>,
) -> &mut Self
pub fn append_identifier( &mut self, id: impl Into<String>, value: impl Into<String>, ) -> &mut Self
Sets an identifier with id (e.g., “book-id”, “isbn-id”)
Sourcepub fn with_coverage(&mut self, coverage: impl Into<String>) -> &mut Self
pub fn with_coverage(&mut self, coverage: impl Into<String>) -> &mut Self
Sets coverage
Sourcepub fn with_description(&mut self, description: impl Into<String>) -> &mut Self
pub fn with_description(&mut self, description: impl Into<String>) -> &mut Self
Sets description
Sourcepub fn with_format(&mut self, format: impl Into<String>) -> &mut Self
pub fn with_format(&mut self, format: impl Into<String>) -> &mut Self
Sets format
Sourcepub fn with_publisher(&mut self, publisher: impl Into<String>) -> &mut Self
pub fn with_publisher(&mut self, publisher: impl Into<String>) -> &mut Self
Sets publisher
Sourcepub fn with_rights(&mut self, rights: impl Into<String>) -> &mut Self
pub fn with_rights(&mut self, rights: impl Into<String>) -> &mut Self
Sets rights
Sourcepub fn with_source(&mut self, source: impl Into<String>) -> &mut Self
pub fn with_source(&mut self, source: impl Into<String>) -> &mut Self
Sets source
Sourcepub fn with_epub_type(&mut self, epub_type: impl Into<String>) -> &mut Self
pub fn with_epub_type(&mut self, epub_type: impl Into<String>) -> &mut Self
Sets epub type
Sourcepub fn build(&self) -> MetadataSheet
pub fn build(&self) -> MetadataSheet
Builds the Metadata instance (returns a clone)
Trait Implementations§
Source§impl Debug for MetadataSheet
impl Debug for MetadataSheet
Source§impl Default for MetadataSheet
impl Default for MetadataSheet
Source§fn default() -> MetadataSheet
fn default() -> MetadataSheet
Source§impl From<MetadataSheet> for Vec<MetadataItem>
Available on crate feature builder only.
impl From<MetadataSheet> for Vec<MetadataItem>
builder only.Source§fn from(sheet: MetadataSheet) -> Vec<MetadataItem>
fn from(sheet: MetadataSheet) -> Vec<MetadataItem>
Converts a MetadataSheet into a Vec<MetadataItem> for EPUB use
This conversion maps Dublin Core metadata fields from MetadataSheet to
the EPUB-compliant MetadataItem format. Each field in MetadataSheet
is converted to a corresponding MetadataItem.