pub struct InputReference { /* private fields */ }Expand description
The Reference model: a class-specific overlay reachable through accessor methods.
All shared bibliographic data (id, title, contributors, dates, publisher, …)
lives inside the class-specific payload in extension. The accessor methods
(id(), title(), etc.) dispatch through the extension and are the public
read path; the typed setters (set_id, …) are the public mutation path.
Implementations§
Source§impl InputReference
impl InputReference
Sourcepub fn identifiers(&self) -> &SupplementaryIdentifiers
pub fn identifiers(&self) -> &SupplementaryIdentifiers
Return all supplementary standardized identifiers.
Sourcepub fn identifier(&self, name: &str) -> Option<&str>
pub fn identifier(&self, name: &str) -> Option<&str>
Return one supplementary standardized identifier.
Sourcepub fn insert_identifier(
&mut self,
name: IdentifierName,
value: impl Into<String>,
) -> Option<String>
pub fn insert_identifier( &mut self, name: IdentifierName, value: impl Into<String>, ) -> Option<String>
Insert one supplementary standardized identifier.
Sourcepub fn class(&self) -> ReferenceClass
pub fn class(&self) -> ReferenceClass
Return the typed class discriminator.
Sourcepub fn extension(&self) -> &ClassExtension
pub fn extension(&self) -> &ClassExtension
Return the active class-specific overlay.
Sourcepub fn extension_mut(&mut self) -> &mut ClassExtension
pub fn extension_mut(&mut self) -> &mut ClassExtension
Return the mutable active class-specific overlay.
Sourcepub fn as_monograph(&self) -> Option<&Monograph>
pub fn as_monograph(&self) -> Option<&Monograph>
Return monograph data when this reference is a monograph.
Sourcepub fn as_collection_component(&self) -> Option<&CollectionComponent>
pub fn as_collection_component(&self) -> Option<&CollectionComponent>
Return collection-component data when this reference is a collection component.
Sourcepub fn as_serial_component(&self) -> Option<&SerialComponent>
pub fn as_serial_component(&self) -> Option<&SerialComponent>
Return serial-component data when this reference is a serial component.
Sourcepub fn as_collection(&self) -> Option<&Collection>
pub fn as_collection(&self) -> Option<&Collection>
Return collection data when this reference is a collection.
Sourcepub fn as_legal_case(&self) -> Option<&LegalCase>
pub fn as_legal_case(&self) -> Option<&LegalCase>
Return legal-case data when this reference is a legal case.
Sourcepub fn as_statute(&self) -> Option<&Statute>
pub fn as_statute(&self) -> Option<&Statute>
Return statute data when this reference is a statute.
Sourcepub fn as_hearing(&self) -> Option<&Hearing>
pub fn as_hearing(&self) -> Option<&Hearing>
Return hearing data when this reference is a hearing.
Sourcepub fn as_regulation(&self) -> Option<&Regulation>
pub fn as_regulation(&self) -> Option<&Regulation>
Return regulation data when this reference is a regulation.
Sourcepub fn as_classic(&self) -> Option<&Classic>
pub fn as_classic(&self) -> Option<&Classic>
Return classic-work data when this reference is a classic.
Sourcepub fn as_dataset(&self) -> Option<&Dataset>
pub fn as_dataset(&self) -> Option<&Dataset>
Return dataset data when this reference is a dataset.
Sourcepub fn as_standard(&self) -> Option<&Standard>
pub fn as_standard(&self) -> Option<&Standard>
Return standard data when this reference is a standard.
Sourcepub fn as_software(&self) -> Option<&Software>
pub fn as_software(&self) -> Option<&Software>
Return software data when this reference is software.
Sourcepub fn as_audio_visual(&self) -> Option<&AudioVisualWork>
pub fn as_audio_visual(&self) -> Option<&AudioVisualWork>
Return audio-visual data when this reference is audio-visual.
Sourcepub fn unknown_class(&self) -> Option<&UnknownClassData>
pub fn unknown_class(&self) -> Option<&UnknownClassData>
Return unknown-class data when this reference names an unknown class.
Sourcepub fn numbering_value(&self, numbering_type: &NumberingType) -> Option<String>
pub fn numbering_value(&self, numbering_type: &NumberingType) -> Option<String>
Return the numbering value for an arbitrary numbering kind.
Return the author.
pub fn editor(&self) -> Option<Contributor>
Sourcepub fn local_editor(&self) -> Option<Contributor>
pub fn local_editor(&self) -> Option<Contributor>
Return an editor attached directly to this work, excluding an enclosing container’s editor.
Sourcepub fn translator(&self) -> Option<Contributor>
pub fn translator(&self) -> Option<Contributor>
Return the translator.
Sourcepub fn contributor(&self, role: ContributorRole) -> Option<Contributor>
pub fn contributor(&self, role: ContributorRole) -> Option<Contributor>
Returns contributors matching role for any reference class that
carries a contributors list.
Returns None if no contributors with the given role exist.
Returns a single Contributor directly, or folds multiple into a ContributorList.
Sourcepub fn contributor_entries(
&self,
role: &ContributorRole,
) -> Vec<&ContributorEntry>
pub fn contributor_entries( &self, role: &ContributorRole, ) -> Vec<&ContributorEntry>
Return all contributor entries matching the requested role.
Sourcepub fn all_contributor_entries(&self) -> &[ContributorEntry]
pub fn all_contributor_entries(&self) -> &[ContributorEntry]
Return all contributor entries regardless of role.
Sourcepub fn volume_title(&self) -> Option<String>
pub fn volume_title(&self) -> Option<String>
Return the title of an individual volume.
Sourcepub fn effective_issued_date(&self) -> Option<DateValue>
pub fn effective_issued_date(&self) -> Option<DateValue>
Return the effective issued date, falling back to the created date when no explicit issued date is present.
Sourcepub fn copyright(&self) -> Option<DateValue>
pub fn copyright(&self) -> Option<DateValue>
Return the copyright year, a publication-year substitute used when
the true issue date is unknown (GB/T 7714 §7.5.4.3’s c1988).
Sourcepub fn printing(&self) -> Option<DateValue>
pub fn printing(&self) -> Option<DateValue>
Return the printing/impression year, another publication-year
substitute (GB/T 7714 §7.5.4.3’s 1995印刷).
Sourcepub fn ads_bibcode(&self) -> Option<String>
pub fn ads_bibcode(&self) -> Option<String>
Return the ADS bibcode.
Sourcepub fn publisher_place(&self) -> Option<String>
pub fn publisher_place(&self) -> Option<String>
Return the publisher place.
Sourcepub fn publisher_str(&self) -> Option<String>
pub fn publisher_str(&self) -> Option<String>
Return the publisher as a string.
Sourcepub fn genre(&self) -> Option<String>
pub fn genre(&self) -> Option<String>
Return the genre/type as string, normalized to canonical kebab-case.
Sourcepub fn archive_location(&self) -> Option<String>
pub fn archive_location(&self) -> Option<String>
Return the archive shelfmark or repository location.
Sourcepub fn archive_name(&self) -> Option<MultilingualString>
pub fn archive_name(&self) -> Option<MultilingualString>
Return the archive name from structured ArchiveInfo.
Sourcepub fn archive_place(&self) -> Option<String>
pub fn archive_place(&self) -> Option<String>
Return the archive geographic place from structured ArchiveInfo.
Sourcepub fn archive_collection(&self) -> Option<String>
pub fn archive_collection(&self) -> Option<String>
Return the archive collection name from structured ArchiveInfo.
Sourcepub fn archive_collection_id(&self) -> Option<String>
pub fn archive_collection_id(&self) -> Option<String>
Return the archive collection identifier from structured ArchiveInfo.
Sourcepub fn archive_series(&self) -> Option<String>
pub fn archive_series(&self) -> Option<String>
Return the archive series from structured ArchiveInfo.
Sourcepub fn archive_box(&self) -> Option<String>
pub fn archive_box(&self) -> Option<String>
Return the archive box number from structured ArchiveInfo.
Sourcepub fn archive_folder(&self) -> Option<String>
pub fn archive_folder(&self) -> Option<String>
Return the archive folder from structured ArchiveInfo.
Sourcepub fn archive_item(&self) -> Option<String>
pub fn archive_item(&self) -> Option<String>
Return the archive item identifier from structured ArchiveInfo.
Sourcepub fn archive_url(&self) -> Option<Url>
pub fn archive_url(&self) -> Option<Url>
Return the archive URL from structured ArchiveInfo.
Sourcepub fn eprint_server(&self) -> Option<String>
pub fn eprint_server(&self) -> Option<String>
Return the eprint server name.
Sourcepub fn eprint_class(&self) -> Option<String>
pub fn eprint_class(&self) -> Option<String>
Return the eprint subject class.
Sourcepub fn abstract_text(&self) -> Option<RichText>
pub fn abstract_text(&self) -> Option<RichText>
Return the abstract.
Sourcepub fn container_title(&self) -> Option<Title>
pub fn container_title(&self) -> Option<Title>
Return the container-style title for parent works, reporters, or codes.
Sourcepub fn collection_title(&self) -> Option<Title>
pub fn collection_title(&self) -> Option<Title>
Return the series or collection title for a parent work.
Sourcepub fn collection_number(&self) -> Option<String>
pub fn collection_number(&self) -> Option<String>
Return the collection number (series number).
Return the authority (court, legislative body, standards org, etc.).
Sourcepub fn section(&self) -> Option<String>
pub fn section(&self) -> Option<String>
Return the section identifier for legal, classic, or serial-component references.
Sourcepub fn report_number(&self) -> Option<String>
pub fn report_number(&self) -> Option<String>
Return the report identifier.
Sourcepub fn unknown_fields(&self) -> Option<&BTreeMap<String, JsonValue>>
pub fn unknown_fields(&self) -> Option<&BTreeMap<String, JsonValue>>
Return the forward-compat unknown_fields captured for this reference.
Returns None for unknown-class references: their fields are kept
wholesale in UnknownClassData::fields and reported separately via
the unknown-class warning.
Sourcepub fn original_date(&self) -> Option<DateValue>
pub fn original_date(&self) -> Option<DateValue>
Return the original publication date.
Sourcepub fn original_title(&self) -> Option<Title>
pub fn original_title(&self) -> Option<Title>
Return the original title.
Sourcepub fn original_publisher_str(&self) -> Option<String>
pub fn original_publisher_str(&self) -> Option<String>
Return the original publisher as a string.
Sourcepub fn original_publisher_place(&self) -> Option<String>
pub fn original_publisher_place(&self) -> Option<String>
Return the original publisher place.
Sourcepub fn field_languages(&self) -> &FieldLanguageMap
pub fn field_languages(&self) -> &FieldLanguageMap
Return field-level language overrides.
Sourcepub fn set_id(&mut self, id: impl Into<RefID>)
pub fn set_id(&mut self, id: impl Into<RefID>)
Set the reference ID on the class-specific extension.
For unknown-class references the id is stored as a JsonValue::String
inside UnknownClassData::fields["id"]. The wire schema requires
id: string, so round-trip is lossless for valid inputs.
Sourcepub fn normalize_contributors(&mut self)
pub fn normalize_contributors(&mut self)
Fold legacy contributor shorthands (author, editor, translator)
into the canonical contributors vec on this reference and, when it has
one, on its embedded container.
Deserialized references are already normalized as part of their
#[serde(from = "...Deser")] conversion; this exists for references
built directly in Rust — such as the biblatex converter — whose
shorthand fields are skip_serializing and would otherwise be silently
dropped on write. Idempotent — safe to call on an already-normalized
reference.
Recurses into container only; original, event, and reviewed
relations are not visited.
Source§impl InputReference
impl InputReference
Sourcepub fn Monograph(reference: Box<Monograph>) -> Self
pub fn Monograph(reference: Box<Monograph>) -> Self
Construct a monograph reference (transitional; see block note above).
Sourcepub fn CollectionComponent(reference: Box<CollectionComponent>) -> Self
pub fn CollectionComponent(reference: Box<CollectionComponent>) -> Self
Construct a collection-component reference.
Sourcepub fn SerialComponent(reference: Box<SerialComponent>) -> Self
pub fn SerialComponent(reference: Box<SerialComponent>) -> Self
Construct a serial-component reference.
Sourcepub fn Collection(reference: Box<Collection>) -> Self
pub fn Collection(reference: Box<Collection>) -> Self
Construct a collection reference.
Sourcepub fn Regulation(reference: Box<Regulation>) -> Self
pub fn Regulation(reference: Box<Regulation>) -> Self
Construct a regulation reference.
Sourcepub fn AudioVisual(reference: Box<AudioVisualWork>) -> Self
pub fn AudioVisual(reference: Box<AudioVisualWork>) -> Self
Construct an audio-visual reference.
Sourcepub fn Unknown(reference: Box<UnknownClassData>) -> Self
pub fn Unknown(reference: Box<UnknownClassData>) -> Self
Construct an unknown-class reference.
Trait Implementations§
Source§impl Clone for InputReference
impl Clone for InputReference
Source§fn clone(&self) -> InputReference
fn clone(&self) -> InputReference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more