Enum inspirer::Sources [] [src]

pub enum Sources<'a> {
    Inspire(RecID<'a>),
    Ads(BibCode<'a>),
    Arxiv,
    None,
}

Variants

Trait Implementations

impl<'a> Debug for Sources<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> PartialEq for Sources<'a>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'a> From<&'a str> for Sources<'a>
[src]

Guess a likely source for a BibTeX key

Returns Sources::None if unable to make a good guess.

Examples

extern crate inspirer;
extern crate libinspire;
let inspirer = inspirer::Inspirer::init(None);

assert_eq!(
    inspirer::Sources::from("Randall:1999ee"),
    inspirer::Sources::Inspire(libinspire::RecID::new("Randall:1999ee").unwrap())
);
extern crate inspirer;
extern crate libads;
let inspirer = inspirer::Inspirer::init(None);

assert_eq!(
    inspirer::Sources::from("1999PhRvL..83.3370R"),
    inspirer::Sources::Ads(libads::BibCode::new("1999PhRvL..83.3370R").unwrap())
);

[src]

Performs the conversion.