#[non_exhaustive]
pub struct SourceDescription {
Show 22 fields pub id: Option<Id>, pub resource_type: Option<ResourceType>, pub citations: Vec<SourceCitation>, pub media_type: Option<String>, pub about: Option<Uri>, pub mediator: Option<ResourceReference>, pub publisher: Option<ResourceReference>, pub authors: Vec<ResourceReference>, pub sources: Vec<SourceReference>, pub analysis: Option<ResourceReference>, pub component_of: Option<SourceReference>, pub titles: Vec<TextValue>, pub notes: Vec<Note>, pub attribution: Option<Attribution>, pub rights: Vec<ResourceReference>, pub coverage: Vec<Coverage>, pub descriptions: Vec<TextValue>, pub identifiers: Vec<Identifier>, pub created: Option<Timestamp>, pub modified: Option<Timestamp>, pub published: Option<Timestamp>, pub repository: Option<ResourceReference>,
}
Expand description

A description of a source of genealogical information.

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.
§id: Option<Id>

An identifier for the data structure holding the source description data.

§resource_type: Option<ResourceType>

The type of resource being described.

§citations: Vec<SourceCitation>

The citation(s) for this source.

At least one citation MUST be provided. If more than one citation is provided, citations are assumed to be given in order of preference, with the most preferred citation in the first position in the list.

§media_type: Option<String>

A hint about the media type of the resource being described.

If provided, MUST be a valid MIME (media) type as specified by RFC 4288.

§about: Option<Uri>

A uniform resource identifier (URI) for the resource being described.

§mediator: Option<ResourceReference>

A reference to the entity that mediates access to the described source.

If provided, MUST resolve to an instance of http://gedcomx.org/v1/Agent.

§publisher: Option<ResourceReference>

A reference to the entity responsible for making the described source available.

If provided, MUST resolve to an instance of http://gedcomx.org/v1/Agent.

§authors: Vec<ResourceReference>

A reference to the entities that authored the described source.

If provided, MUST resolve to an instance of http://gedcomx.org/v1/Agent.

§sources: Vec<SourceReference>

A list of references to any sources from which this source is derived.

§analysis: Option<ResourceReference>

A reference to a document containing analysis about this source.

If provided, MUST resolve to an instance of http://gedcomx.org/v1/Document of type http://gedcomx.org/Analysis.

§component_of: Option<SourceReference>

A reference to the source that contains this source, i.e. its parent context. Used when the description of a source is not complete without the description of its parent (or containing) source.

§titles: Vec<TextValue>

The display name(s) for this source.

If more than one title is provided, titles are assumed to be given in order of preference, with the most preferred title in the first position in the list.

§notes: Vec<Note>

A list of notes about a source.

§attribution: Option<Attribution>

The attribution of this source description.

If not provided, the attribution of the containing data set (e.g. file) of the source description is assumed.

§rights: Vec<ResourceReference>

The rights for this resource.

§coverage: Vec<Coverage>

The coverage of the resource.

§descriptions: Vec<TextValue>

Human-readable descriptions of this source.

If more than one description is provided, descriptions are assumed to be given in order of preference, with the most preferred description in the first position in the list.

§identifiers: Vec<Identifier>

A list of identifiers for the resource being described.

§created: Option<Timestamp>

Timestamp of when the resource being described was created.

§modified: Option<Timestamp>

Timestamp of when the resource being described was modified.

§published: Option<Timestamp>

Timestamp of when the resource being described was published.

§repository: Option<ResourceReference>

A reference to the repository that contains the described resource.

If provided, MUST resolve to an instance of http://gedcomx.org/v1/Agent.

Implementations§

source§

impl SourceDescription

source

pub fn new( id: Option<Id>, resource_type: Option<ResourceType>, citations: Vec<SourceCitation>, media_type: Option<String>, about: Option<Uri>, mediator: Option<ResourceReference>, publisher: Option<ResourceReference>, authors: Vec<ResourceReference>, sources: Vec<SourceReference>, analysis: Option<ResourceReference>, component_of: Option<SourceReference>, titles: Vec<TextValue>, notes: Vec<Note>, attribution: Option<Attribution>, rights: Vec<ResourceReference>, coverage: Vec<Coverage>, descriptions: Vec<TextValue>, identifiers: Vec<Identifier>, created: Option<Timestamp>, modified: Option<Timestamp>, published: Option<Timestamp>, repository: Option<ResourceReference> ) -> Self

source

pub fn builder(citation: SourceCitation) -> SourceDescriptionBuilder

Trait Implementations§

source§

impl Arbitrary for SourceDescription

source§

fn arbitrary(g: &mut Gen) -> Self

Return an arbitrary value. Read more
source§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>, Global>

Return an iterator of values that are smaller than itself. Read more
source§

impl Clone for SourceDescription

source§

fn clone(&self) -> SourceDescription

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SourceDescription

source§

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

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

impl Default for SourceDescription

source§

fn default() -> SourceDescription

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for SourceDescription

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<SourceDescription> for SourceDescription

source§

fn eq(&self, other: &SourceDescription) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for SourceDescription

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&SourceDescription> for SourceReference

§

type Error = GedcomxError

The type returned in the event of a conversion error.
source§

fn try_from(s: &SourceDescription) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&SourceDescription> for Uri

§

type Error = GedcomxError

The type returned in the event of a conversion error.
source§

fn try_from(sd: &SourceDescription) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl YaDeserialize for SourceDescription

source§

fn deserialize<R: Read>(reader: &mut Deserializer<R>) -> Result<Self, String>

source§

impl YaSerialize for SourceDescription

source§

fn serialize<W: Write>(&self, writer: &mut Serializer<W>) -> Result<(), String>

source§

fn serialize_attributes( &self, source_attributes: Vec<OwnedAttribute>, source_namespace: Namespace ) -> Result<(Vec<OwnedAttribute>, Namespace), String>

source§

impl StructuralPartialEq for SourceDescription

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,