Skip to main content

Citation

Struct Citation 

Source
pub struct Citation {
    pub key: &'static str,
    pub authors: &'static [(&'static str, &'static str)],
    pub year: u16,
    pub title: &'static str,
    pub venue: &'static str,
    pub volume: Option<&'static str>,
    pub issue: Option<&'static str>,
    pub pages: Option<&'static str>,
    pub doi: Option<&'static str>,
    pub url: Option<&'static str>,
    pub kind: Kind,
    pub tier: Tier,
}
Expand description

One bibliographic reference.

Fields§

§key: &'static str

Stable citation key (familyYYYY, lower-case ASCII).

§authors: &'static [(&'static str, &'static str)]

Authors in publication order as (family, given). A group author has an empty given.

§year: u16

Year of the issue (for the DiMA paper: 2025, although it was published online in 2024).

§title: &'static str

Title, sentence case as published.

§venue: &'static str

Journal, proceedings, book or issuing body.

§volume: Option<&'static str>

Volume, if any.

§issue: Option<&'static str>

Issue, if any.

§pages: Option<&'static str>

Page range (first-last) or article number.

§doi: Option<&'static str>

DOI without the resolver prefix.

§url: Option<&'static str>

Canonical URL, for references without a DOI.

§kind: Kind

Publication type.

§tier: Tier

Citation-policy tier.

Implementations§

Source§

impl Citation

Source

pub fn designation(&self) -> Option<&'static str>

The short name its publisher gives this standard, used as its label: RFC 8259, UAX #15, WCAG 2.2; None for every other reference.

Source

pub fn short(&self) -> String

The in-text label, the same on every surface: Tharanga et al. 2025, Grüning, Dale et al. 2018, RFC 8259 (see the module documentation for the rule).

Source

pub fn listed_year(&self) -> String

The year as dima’s own name-year lists show it: 2018, or 2024a when a year letter tells apart works with identical authors and year.

doi:… if the reference has a DOI, else its URL.

Source

pub fn href(&self) -> Option<String>

Resolvable URL: https://doi.org/… for a DOI, else the stored URL.

Source

pub fn text(&self) -> String

Full plain-text reference (Vancouver/NLM style), as exported (run.references, dima cite), e.g. Tharanga S, Ünlü ES, … Khan AM. DiMA: sequence diversity dynamics analyser for viruses. Briefings in Bioinformatics. 2025;26(1):bbae607. doi:10.1093/bib/bbae607.

Source

pub fn listed_text(&self) -> String

Citation::text as dima’s own reference lists show it (the documentation and its Bibliography): led by the designation of a standard that has one, and with a year letter where the label has one (Citation::listed_year).

Source

pub fn bibtex(&self) -> String

BibTeX entry.

Source

pub fn ris(&self) -> String

RIS record (one tag per line, terminated by ER -).

Source

pub fn cff(&self, indent: usize) -> String

The reference as a CFF 1.2.0 reference object, as YAML lines indented by indent spaces (the first line starts with type:).

Trait Implementations§

Source§

impl Debug for Citation

Source§

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

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

impl Eq for Citation

Source§

impl From<&Citation> for Reference

Source§

fn from(c: &Citation) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Citation

Source§

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

Auto Trait Implementations§

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
§

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

§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more