pub struct Bibliography { /* private fields */ }Expand description
Every citation key defined by a directory of .bib files, and the entry each
key resolves to.
Implementations§
Source§impl Bibliography
impl Bibliography
Sourcepub fn load_dir(dir: impl AsRef<Path>) -> Result<Self>
pub fn load_dir(dir: impl AsRef<Path>) -> Result<Self>
Loads every *.bib file directly inside dir (non-recursive) and merges
their entries into one bibliography.
Files are processed in sorted filename order. Directory read order is OS-dependent, so sorting first is what makes both iteration order and duplicate-key attribution reproducible across machines rather than incidental.
A directory holding no .bib files loads to an empty bibliography rather than
an error: a docs project can legitimately wire up its bibliography directory
before writing the first citation.
§Errors
CiteError::Ioifdiror one of its.bibfiles cannot be read.CiteError::Parse, naming the offending file, if a.bibfile is malformed.CiteError::DuplicateKey, naming both files, if two files define one key.
Sourcepub fn from_entries(entries: impl IntoIterator<Item = (String, Entry)>) -> Self
pub fn from_entries(entries: impl IntoIterator<Item = (String, Entry)>) -> Self
Builds a bibliography directly from parsed entries, for callers that hold
.bib content in memory rather than on disk.
Trait Implementations§
Source§impl Clone for Bibliography
impl Clone for Bibliography
Source§impl Debug for Bibliography
impl Debug for Bibliography
Auto Trait Implementations§
impl Freeze for Bibliography
impl RefUnwindSafe for Bibliography
impl Send for Bibliography
impl Sync for Bibliography
impl Unpin for Bibliography
impl UnsafeUnpin for Bibliography
impl UnwindSafe for Bibliography
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