Struct biblatex::Bibliography

source ·
pub struct Bibliography { /* private fields */ }
Expand description

A fully parsed bibliography.

Implementations§

source§

impl Bibliography

source

pub fn new() -> Self

Create a new, empty bibliography.

source

pub fn parse(src: &str) -> Result<Self, ParseError>

Parse a bibliography from a source string.

source

pub fn from_raw(raw: RawBibliography<'_>) -> Result<Self, ParseError>

Construct a bibliography from a raw bibliography, with the xdata and crossref links resolved.

source

pub fn len(&self) -> usize

The number of bibliography entries.

source

pub fn is_empty(&self) -> bool

Whether the bibliography is empty.

source

pub fn get(&self, key: &str) -> Option<&Entry>

Returns the entry with the given cite key.

source

pub fn get_mut(&mut self, key: &str) -> Option<&mut Entry>

Returns a mutable reference to the entry with the given cite key.

source

pub fn insert(&mut self, entry: Entry) -> Option<Entry>

Insert an entry into the bibliography.

If an entry with the same cite key is already present, the entry is updated and the old entry is returned.

source

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

Remove the entry with the given cite key.

source

pub fn alias(&mut self, key: &str, alias: impl Into<String>)

Add an alias for a cite key.

Does nothing if no entry with the given cite key exists.

source

pub fn iter(&self) -> Iter<'_, Entry>

An iterator over the bibliography’s entries.

source

pub fn iter_mut(&mut self) -> IterMut<'_, Entry>

A mutable iterator over the bibliography’s entries.

source

pub fn into_vec(self) -> Vec<Entry>

Consume this struct and return a vector of the bibliography’s entries.

source

pub fn write_biblatex(&self, sink: impl Write) -> Result

Write the entry into a writer in the BibLaTeX format.

source

pub fn to_biblatex_string(&self) -> String

Serialize this bibliography into a BibLaTeX string.

source

pub fn write_bibtex(&self, sink: impl Write) -> Result

Write the entry into a writer in the BibTeX format.

source

pub fn to_bibtex_string(&self) -> String

Serialize this bibliography into a BibTeX string.

Trait Implementations§

source§

impl Clone for Bibliography

source§

fn clone(&self) -> Bibliography

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 Bibliography

source§

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

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

impl Default for Bibliography

source§

fn default() -> Bibliography

Returns the “default value” for a type. Read more
source§

impl IntoIterator for Bibliography

§

type Item = Entry

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Entry>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for Bibliography

source§

fn eq(&self, other: &Bibliography) -> 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 Bibliography

source§

impl StructuralEq for Bibliography

source§

impl StructuralPartialEq for Bibliography

Auto Trait Implementations§

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.