Struct biblatex::Entry

source ·
pub struct Entry {
    pub key: String,
    pub entry_type: EntryType,
    pub fields: BTreeMap<String, Chunks>,
}
Expand description

A bibliography entry containing chunk fields, which can be parsed into more specific types on demand.

Fields§

§key: String

The citation key.

§entry_type: EntryType

Denotes the type of bibliography item (e.g., Article).

§fields: BTreeMap<String, Chunks>

Maps from field names to their associated chunk vectors.

Implementations§

source§

impl Entry

source

pub fn new(key: String, entry_type: EntryType) -> Self

Construct new, empty entry.

source

pub fn get(&self, key: &str) -> Option<ChunksRef<'_>>

Get the chunk slice of a field.

The field key must be lowercase.

source

pub fn get_as<T: Type>(&self, key: &str) -> Result<T, RetrievalError>

Parse the value of a field into a specific type.

The field key must be lowercase.

source

pub fn set(&mut self, key: &str, chunks: Chunks)

Set the chunk slice for a field.

The field key is lowercase before insertion.

source

pub fn set_as<T: Type>(&mut self, key: &str, value: &T)

Set the value of a field as a specific type.

The field key is lowercase before insertion.

source

pub fn remove(&mut self, key: &str) -> Option<Chunks>

Remove a field from the entry.

source

pub fn parents(&self) -> Result<Vec<String>, TypeError>

The parents of an entry in a semantic sense (crossref and xref).

source

pub fn verify(&self) -> Report

Verify if the entry has the appropriate fields for its EntryType.

source

pub fn to_biblatex_string(&self) -> String

Serialize this entry into a BibLaTeX string.

source

pub fn to_bibtex_string(&self) -> Result<String, TypeError>

Serialize this entry into a BibTeX string.

This function can return an error if there is a malformed date field.

source§

impl Entry

source

pub fn author(&self) -> Result<Vec<Person>, RetrievalError>

Get the author field.

source

pub fn set_author(&mut self, item: Vec<Person>)

Set the value of the author field.

source

pub fn book_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the booktitle field.

source

pub fn set_book_title(&mut self, item: Chunks)

Set the value of the booktitle field.

source

pub fn chapter(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the chapter field.

source

pub fn set_chapter(&mut self, item: Chunks)

Set the value of the chapter field.

source

pub fn edition(&self) -> Result<PermissiveType<i64>, RetrievalError>

Get the edition field.

source

pub fn set_edition(&mut self, item: PermissiveType<i64>)

Set the value of the edition field.

source

pub fn how_published(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the howpublished field.

source

pub fn set_how_published(&mut self, item: Chunks)

Set the value of the howpublished field.

source

pub fn note(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the note field.

source

pub fn set_note(&mut self, item: Chunks)

Set the value of the note field.

source

pub fn number(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the number field.

source

pub fn set_number(&mut self, item: Chunks)

Set the value of the number field.

source

pub fn organization(&self) -> Result<Vec<Chunks>, RetrievalError>

Get the organization field.

source

pub fn set_organization(&mut self, item: Vec<Chunks>)

Set the value of the organization field.

source

pub fn pages(&self) -> Result<PermissiveType<Vec<Range<u32>>>, RetrievalError>

Get the pages field.

source

pub fn set_pages(&mut self, item: PermissiveType<Vec<Range<u32>>>)

Set the value of the pages field.

source

pub fn publisher(&self) -> Result<Vec<Chunks>, RetrievalError>

Get the publisher field.

source

pub fn set_publisher(&mut self, item: Vec<Chunks>)

Set the value of the publisher field.

source

pub fn series(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the series field.

source

pub fn set_series(&mut self, item: Chunks)

Set the value of the series field.

source

pub fn title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the title field.

source

pub fn set_title(&mut self, item: Chunks)

Set the value of the title field.

source

pub fn type_(&self) -> Result<String, RetrievalError>

Get the type field.

source

pub fn set_type_(&mut self, item: String)

Set the value of the type field.

source

pub fn volume(&self) -> Result<PermissiveType<i64>, RetrievalError>

Get the volume field.

source

pub fn set_volume(&mut self, item: PermissiveType<i64>)

Set the value of the volume field.

source

pub fn address(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the address field, falling back on location if address is empty.

source

pub fn set_address(&mut self, item: Chunks)

Set the value of the address field.

source

pub fn location(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the location field, falling back on address if location is empty.

source

pub fn set_location(&mut self, item: Chunks)

Set the value of the location field.

source

pub fn annotation(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the annotation field, falling back on annote if annotation is empty.

source

pub fn set_annotation(&mut self, item: Chunks)

Set the value of the annotation field.

source

pub fn eprint_type(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the eprinttype field, falling back on archiveprefix if eprinttype is empty.

source

pub fn set_eprint_type(&mut self, item: Chunks)

Set the value of the eprinttype field.

source

pub fn journal(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the journal field, falling back on journaltitle if journal is empty.

source

pub fn set_journal(&mut self, item: Chunks)

Set the value of the journal field.

source

pub fn journal_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the journaltitle field, falling back on journal if journaltitle is empty.

source

pub fn set_journal_title(&mut self, item: Chunks)

Set the value of the journaltitle field.

source

pub fn sort_key(&self) -> Result<String, RetrievalError>

Get the key field, falling back on sortkey if key is empty.

source

pub fn set_sort_key(&mut self, item: String)

Set the value of the key field.

source

pub fn file(&self) -> Result<String, RetrievalError>

Get the file field, falling back on pdf if file is empty.

source

pub fn set_file(&mut self, item: String)

Set the value of the file field.

source

pub fn school(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the school field, falling back on institution if school is empty.

source

pub fn set_school(&mut self, item: Chunks)

Set the value of the school field.

source

pub fn institution(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the institution field, falling back on school if institution is empty.

source

pub fn set_institution(&mut self, item: Chunks)

Set the value of the institution field.

source

pub fn date(&self) -> Result<PermissiveType<Date>, RetrievalError>

Get the date field, falling back on the year, month, and day fields if it is not present.

source

pub fn set_date(&mut self, item: PermissiveType<Date>)

Set the value of the date field, removing the year, month, and day fields if present.

source

pub fn event_date(&self) -> Result<PermissiveType<Date>, RetrievalError>

Get the eventdate field, falling back on the eventyear, eventmonth, and eventday fields if it is not present.

source

pub fn set_event_date(&mut self, item: PermissiveType<Date>)

Set the value of the eventdate field, removing the eventyear, eventmonth, and eventday fields if present.

source

pub fn orig_date(&self) -> Result<PermissiveType<Date>, RetrievalError>

Get the origdate field, falling back on the origyear, origmonth, and origday fields if it is not present.

source

pub fn set_orig_date(&mut self, item: PermissiveType<Date>)

Set the value of the origdate field, removing the origyear, origmonth, and origday fields if present.

source

pub fn url_date(&self) -> Result<PermissiveType<Date>, RetrievalError>

Get the urldate field, falling back on the urlyear, urlmonth, and urlday fields if it is not present.

source

pub fn set_url_date(&mut self, item: PermissiveType<Date>)

Set the value of the urldate field, removing the urlyear, urlmonth, and urlday fields if present.

source

pub fn editors(&self) -> Result<Vec<(Vec<Person>, EditorType)>, TypeError>

Get the editor and editora through editorc fields and their respective editortype annotation fields, returning a vector with zero to four entries, one for each editorial role.

The default EditorType::Editor is assumed if the type field is empty.

source

pub fn abstract_(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the abstract field.

source

pub fn set_abstract_(&mut self, item: Chunks)

Set the value of the abstract field.

source

pub fn addendum(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the addendum field.

source

pub fn set_addendum(&mut self, item: Chunks)

Set the value of the addendum field.

source

pub fn afterword(&self) -> Result<Vec<Person>, RetrievalError>

Get the afterword field.

source

pub fn set_afterword(&mut self, item: Vec<Person>)

Set the value of the afterword field.

source

pub fn annotator(&self) -> Result<Vec<Person>, RetrievalError>

Get the annotator field.

source

pub fn set_annotator(&mut self, item: Vec<Person>)

Set the value of the annotator field.

source

pub fn author_type(&self) -> Result<String, RetrievalError>

Get the authortype field.

source

pub fn set_author_type(&mut self, item: String)

Set the value of the authortype field.

source

pub fn book_author(&self) -> Result<Vec<Person>, RetrievalError>

Get the bookauthor field.

source

pub fn set_book_author(&mut self, item: Vec<Person>)

Set the value of the bookauthor field.

source

pub fn book_pagination(&self) -> Result<Pagination, RetrievalError>

Get the bookpagination field.

source

pub fn set_book_pagination(&mut self, item: Pagination)

Set the value of the bookpagination field.

source

pub fn book_subtitle(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the booksubtitle field.

source

pub fn set_book_subtitle(&mut self, item: Chunks)

Set the value of the booksubtitle field.

source

pub fn book_title_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the booktitleaddon field.

source

pub fn set_book_title_addon(&mut self, item: Chunks)

Set the value of the booktitleaddon field.

source

pub fn commentator(&self) -> Result<Vec<Person>, RetrievalError>

Get the commentator field.

source

pub fn set_commentator(&mut self, item: Vec<Person>)

Set the value of the commentator field.

source

pub fn doi(&self) -> Result<String, RetrievalError>

Get the doi field.

source

pub fn set_doi(&mut self, item: String)

Set the value of the doi field.

source

pub fn eid(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the eid field.

source

pub fn set_eid(&mut self, item: Chunks)

Set the value of the eid field.

source

pub fn entry_subtype(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the entrysubtype field.

source

pub fn set_entry_subtype(&mut self, item: Chunks)

Set the value of the entrysubtype field.

source

pub fn eprint(&self) -> Result<String, RetrievalError>

Get the eprint field.

source

pub fn set_eprint(&mut self, item: String)

Set the value of the eprint field.

source

pub fn eprint_class(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the eprintclass field.

source

pub fn set_eprint_class(&mut self, item: Chunks)

Set the value of the eprintclass field.

source

pub fn eventtitle(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the eventtitle field.

source

pub fn set_eventtitle(&mut self, item: Chunks)

Set the value of the eventtitle field.

source

pub fn eventtitle_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the eventtitleaddon field.

source

pub fn set_eventtitle_addon(&mut self, item: Chunks)

Set the value of the eventtitleaddon field.

source

pub fn foreword(&self) -> Result<Vec<Person>, RetrievalError>

Get the foreword field.

source

pub fn set_foreword(&mut self, item: Vec<Person>)

Set the value of the foreword field.

source

pub fn holder(&self) -> Result<Vec<Person>, RetrievalError>

Get the holder field.

source

pub fn set_holder(&mut self, item: Vec<Person>)

Set the value of the holder field.

source

pub fn index_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the indextitle field.

source

pub fn set_index_title(&mut self, item: Chunks)

Set the value of the indextitle field.

source

pub fn introduction(&self) -> Result<Vec<Person>, RetrievalError>

Get the introduction field.

source

pub fn set_introduction(&mut self, item: Vec<Person>)

Set the value of the introduction field.

source

pub fn isan(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the isan field.

source

pub fn set_isan(&mut self, item: Chunks)

Set the value of the isan field.

source

pub fn isbn(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the isbn field.

source

pub fn set_isbn(&mut self, item: Chunks)

Set the value of the isbn field.

source

pub fn ismn(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the ismn field.

source

pub fn set_ismn(&mut self, item: Chunks)

Set the value of the ismn field.

source

pub fn isrn(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the isrn field.

source

pub fn set_isrn(&mut self, item: Chunks)

Set the value of the isrn field.

source

pub fn issn(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the issn field.

source

pub fn set_issn(&mut self, item: Chunks)

Set the value of the issn field.

source

pub fn issue(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the issue field.

source

pub fn set_issue(&mut self, item: Chunks)

Set the value of the issue field.

source

pub fn issue_subtitle(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the issuesubtitle field.

source

pub fn set_issue_subtitle(&mut self, item: Chunks)

Set the value of the issuesubtitle field.

source

pub fn issue_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the issuetitle field.

source

pub fn set_issue_title(&mut self, item: Chunks)

Set the value of the issuetitle field.

source

pub fn issue_title_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the issuetitleaddon field.

source

pub fn set_issue_title_addon(&mut self, item: Chunks)

Set the value of the issuetitleaddon field.

source

pub fn iswc(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the iswc field.

source

pub fn set_iswc(&mut self, item: Chunks)

Set the value of the iswc field.

source

pub fn journal_subtitle(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the journalsubtitle field.

source

pub fn set_journal_subtitle(&mut self, item: Chunks)

Set the value of the journalsubtitle field.

source

pub fn journal_title_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the journaltitleaddon field.

source

pub fn set_journal_title_addon(&mut self, item: Chunks)

Set the value of the journaltitleaddon field.

source

pub fn keywords(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the keywords field.

source

pub fn set_keywords(&mut self, item: Chunks)

Set the value of the keywords field.

source

pub fn label(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the label field.

source

pub fn set_label(&mut self, item: Chunks)

Set the value of the label field.

source

pub fn language(&self) -> Result<String, RetrievalError>

Get the language field.

source

pub fn set_language(&mut self, item: String)

Set the value of the language field.

source

pub fn library(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the library field.

source

pub fn set_library(&mut self, item: Chunks)

Set the value of the library field.

source

pub fn main_subtitle(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the mainsubtitle field.

source

pub fn set_main_subtitle(&mut self, item: Chunks)

Set the value of the mainsubtitle field.

source

pub fn main_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the maintitle field.

source

pub fn set_main_title(&mut self, item: Chunks)

Set the value of the maintitle field.

source

pub fn main_title_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the maintitleaddon field.

source

pub fn set_main_title_addon(&mut self, item: Chunks)

Set the value of the maintitleaddon field.

source

pub fn name_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the nameaddon field.

source

pub fn set_name_addon(&mut self, item: Chunks)

Set the value of the nameaddon field.

source

pub fn options(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the options field.

source

pub fn set_options(&mut self, item: Chunks)

Set the value of the options field.

source

pub fn orig_language(&self) -> Result<String, RetrievalError>

Get the origlanguage field.

source

pub fn set_orig_language(&mut self, item: String)

Set the value of the origlanguage field.

source

pub fn orig_location(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the origlocation field.

source

pub fn set_orig_location(&mut self, item: Chunks)

Set the value of the origlocation field.

source

pub fn page_total(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the pagetotal field.

source

pub fn set_page_total(&mut self, item: Chunks)

Set the value of the pagetotal field.

source

pub fn pagination(&self) -> Result<Pagination, RetrievalError>

Get the pagination field.

source

pub fn set_pagination(&mut self, item: Pagination)

Set the value of the pagination field.

source

pub fn part(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the part field.

source

pub fn set_part(&mut self, item: Chunks)

Set the value of the part field.

source

pub fn pubstate(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the pubstate field.

source

pub fn set_pubstate(&mut self, item: Chunks)

Set the value of the pubstate field.

source

pub fn reprint_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the reprinttitle field.

source

pub fn set_reprint_title(&mut self, item: Chunks)

Set the value of the reprinttitle field.

source

pub fn short_author(&self) -> Result<Vec<Person>, RetrievalError>

Get the shortauthor field.

source

pub fn set_short_author(&mut self, item: Vec<Person>)

Set the value of the shortauthor field.

source

pub fn short_editor(&self) -> Result<Vec<Person>, RetrievalError>

Get the shorteditor field.

source

pub fn set_short_editor(&mut self, item: Vec<Person>)

Set the value of the shorteditor field.

source

pub fn shorthand(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the shorthand field.

source

pub fn set_shorthand(&mut self, item: Chunks)

Set the value of the shorthand field.

source

pub fn shorthand_intro(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the shorthandintro field.

source

pub fn set_shorthand_intro(&mut self, item: Chunks)

Set the value of the shorthandintro field.

source

pub fn short_journal(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the shortjournal field.

source

pub fn set_short_journal(&mut self, item: Chunks)

Set the value of the shortjournal field.

source

pub fn short_series(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the shortseries field.

source

pub fn set_short_series(&mut self, item: Chunks)

Set the value of the shortseries field.

source

pub fn short_title(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the shorttitle field.

source

pub fn set_short_title(&mut self, item: Chunks)

Set the value of the shorttitle field.

source

pub fn subtitle(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the subtitle field.

source

pub fn set_subtitle(&mut self, item: Chunks)

Set the value of the subtitle field.

source

pub fn title_addon(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the titleaddon field.

source

pub fn set_title_addon(&mut self, item: Chunks)

Set the value of the titleaddon field.

source

pub fn translator(&self) -> Result<Vec<Person>, RetrievalError>

Get the translator field.

source

pub fn set_translator(&mut self, item: Vec<Person>)

Set the value of the translator field.

source

pub fn url(&self) -> Result<String, RetrievalError>

Get the url field.

source

pub fn set_url(&mut self, item: String)

Set the value of the url field.

source

pub fn venue(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the venue field.

source

pub fn set_venue(&mut self, item: Chunks)

Set the value of the venue field.

source

pub fn version(&self) -> Result<ChunksRef<'_>, RetrievalError>

Get the version field.

source

pub fn set_version(&mut self, item: Chunks)

Set the value of the version field.

source

pub fn volumes(&self) -> Result<i64, RetrievalError>

Get the volumes field.

source

pub fn set_volumes(&mut self, item: i64)

Set the value of the volumes field.

source

pub fn gender(&self) -> Result<Gender, RetrievalError>

Get the gender field.

source

pub fn set_gender(&mut self, item: Gender)

Set the value of the gender field.

Trait Implementations§

source§

impl Clone for Entry

source§

fn clone(&self) -> Entry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Entry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Entry

source§

fn eq(&self, other: &Entry) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Entry

source§

impl StructuralEq for Entry

source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.