Struct gedcomx::SourceReference [−][src]
#[non_exhaustive]pub struct SourceReference { pub description: Uri, pub description_id: Option<Id>, pub attribution: Option<Attribution>, pub qualifiers: Vec<Qualifier>, }
Expand description
A reference to a source description.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.description: Uri
Reference to a description of the target source.
MUST resolve to an instance of http://gedcomx.org/v1/SourceDescription.
description_id: Option<Id>
The id of the target source.
attribution: Option<Attribution>
The attribution of this source reference.
If not provided, the attribution of the containing resource of the source reference is assumed.
qualifiers: Vec<Qualifier>
Qualifiers for the reference, used to identify specific fragments of the source that are being referenced.
If present, use of a
SourceReferenceQualifier
is
RECOMMENDED.
Implementations
pub fn new(
description: Uri,
description_id: Option<Id>,
attribution: Option<Attribution>,
qualifiers: Vec<Qualifier>
) -> Self
Errors
Will return GedcomxError::NoId
if a
conversion into SourceReference
fails.
This happens if description
has no id
set.
Trait Implementations
Returns the “default value” for a type. Read more
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type Error = GedcomxError
type Error = GedcomxError
The type returned in the event of a conversion error.
Performs the conversion.
fn serialize_attributes(
&self,
source_attributes: Vec<OwnedAttribute>,
source_namespace: Namespace
) -> Result<(Vec<OwnedAttribute>, Namespace), String>
Auto Trait Implementations
impl RefUnwindSafe for SourceReference
impl Send for SourceReference
impl Sync for SourceReference
impl Unpin for SourceReference
impl UnwindSafe for SourceReference
Blanket Implementations
Mutably borrows from an owned value. Read more