Skip to main content

Model

Struct Model 

Source
pub struct Model { /* private fields */ }
Expand description

A file’s regular entries, @string definitions, and @string uses.

Equality lets incremental queries avoid recomputing unchanged dependents.

Implementations§

Source§

impl Model

Source

pub fn build(root: &SyntaxNode) -> Self

Build the model from a bib parse-tree root.

Source

pub fn entries(&self) -> &[Entry]

Every regular entry, in source order.

Source

pub fn string_defs(&self) -> &[StringDef]

Every @string definition, in source order.

Source

pub fn string_uses(&self) -> &[StringUse]

Every @string use, in source order.

Source

pub fn duplicate_keys(&self) -> impl Iterator<Item = &Entry>

Returns entries whose cite key duplicates an earlier entry in this file.

Source

pub fn undefined_string_uses(&self) -> impl Iterator<Item = &StringUse>

@string uses that match no in-file definition or predefined month macro.

A macro may still be defined in another bibliography file.

Source

pub fn unused_string_defs(&self) -> impl Iterator<Item = &StringDef>

@string definitions never referenced by any use in this file.

A definition may still be used from another bibliography file. Names are compared in lowercase.

Trait Implementations§

Source§

impl Debug for Model

Source§

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

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

impl Default for Model

Source§

fn default() -> Model

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

impl Eq for Model

Source§

impl PartialEq for Model

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Model

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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 T
where U: TryFrom<T>,

Source§

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.