#[non_exhaustive]pub struct Claim {
pub text: Option<String>,
pub ids: Vec<WorkId>,
pub title: Option<String>,
pub authors: Vec<String>,
pub year: Option<i16>,
}Expand description
What a citation asserts. Any part may be missing.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: Option<String>A free-text reference, in any style.
ids: Vec<WorkId>Identifiers asserted for the work.
title: Option<String>Names as written: “Ashish Vaswani”, “Vaswani, A.”, “A. Vaswani”.
year: Option<i16>Implementations§
Source§impl Claim
impl Claim
Sourcepub fn from_text(text: impl Into<String>) -> Self
pub fn from_text(text: impl Into<String>) -> Self
A claim from a free-text reference, with any DOIs and arXiv IDs it mentions extracted as asserted identifiers.
Sourcepub fn from_input(input: &str) -> Self
pub fn from_input(input: &str) -> Self
A claim from whatever a user typed: if the whole input is an
identifier, a claim of just that identifier (an existence check);
otherwise a free-text reference (see Claim::from_text).
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Claim
impl<'de> Deserialize<'de> for Claim
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Claim
impl StructuralPartialEq for Claim
Auto Trait Implementations§
impl Forget for Claim
impl Freeze for Claim
impl RefUnwindSafe for Claim
impl Send for Claim
impl Sync for Claim
impl Unpin for Claim
impl UnsafeUnpin for Claim
impl UnwindSafe for Claim
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