Skip to main content

Concept

Struct Concept 

Source
pub struct Concept { /* private fields */ }
Expand description

Owned ISO 23387 ConceptType: every attribute and child it declares.

Each field corresponds to exactly one declared child element (or attribute), and every repeatable child is a Vec, so a value decoded by Concept-bearing from_element codecs holds everything the schema permits. ConceptType content is a repeating choice, so child order carries no meaning and is not stored.

The schema requires at least one child from the choice, and new always supplies a name. from_identity builds an empty concept for decoders and callers that add content afterwards.

Implementations§

Source§

impl Concept

Source

pub fn to_element_named(&self, local_name: &'static str) -> Element

Encodes this concept as a dt:Subject-free ConceptType element named local_name. Concrete types use their own to_element.

Source§

impl Concept

Source

pub fn from_element(element: &Element) -> Result<Self, CodecError>

Decodes plain ConceptType content (any element name).

Source§

impl Concept

Source

pub fn new( guid: Guid, date_of_creation: DateTime, first_name: MultiLanguageText, definition: MultiLanguageText, ) -> Self

Creates a concept with one name and one definition.

Source

pub const fn from_identity(guid: Guid, date_of_creation: DateTime) -> Self

Creates a concept carrying only its required attributes.

It is not schema-valid until at least one child is added.

Source

pub const fn guid(&self) -> &Guid

Source

pub fn date_of_creation(&self) -> &str

Source

pub fn about(&self) -> Option<&str>

The dt:about attribute, when present.

Source

pub fn set_about(&mut self, value: Option<AnyUri>)

Source

pub fn definition(&self) -> Option<&MultiLanguageText>

The first Definition, when present.

ConceptType permits any number of definitions (typically one per language); use Concept::definitions to see all of them.

Source

pub fn set_definition(&mut self, definition: MultiLanguageText)

Replaces every definition with definition.

Source

pub fn references(&self) -> &[Reference]

👎Deprecated since 0.3.0:

use reference_document_refs

ReferenceDocumentRef children.

Source

pub fn add_reference(&mut self, reference: Reference)

👎Deprecated since 0.3.0:

use add_reference_document_ref

Appends a ReferenceDocumentRef.

Source

pub fn names(&self) -> &[MultiLanguageText]

Name children.

Source

pub fn add_name(&mut self, value: MultiLanguageText)

Name children.

Source

pub fn definitions(&self) -> &[MultiLanguageText]

Definition children.

Source

pub fn add_definition(&mut self, value: MultiLanguageText)

Definition children.

Source

pub fn descriptions(&self) -> &[MultiLanguageText]

Description children.

Source

pub fn add_description(&mut self, value: MultiLanguageText)

Description children.

Source

pub fn examples(&self) -> &[MultiLanguageText]

Example children.

Source

pub fn add_example(&mut self, value: MultiLanguageText)

Example children.

Source

pub fn reference_document_refs(&self) -> &[Reference]

ReferenceDocumentRef children.

Source

pub fn add_reference_document_ref(&mut self, value: Reference)

ReferenceDocumentRef children.

Source

pub fn similar_to_refs(&self) -> &[Reference]

SimilarToRef children.

Source

pub fn add_similar_to_ref(&mut self, value: Reference)

SimilarToRef children.

Source

pub fn replaced_objects_refs(&self) -> &[Reference]

ReplacedObjectsRef children.

Source

pub fn add_replaced_objects_ref(&mut self, value: Reference)

ReplacedObjectsRef children.

Source

pub fn dictionary_refs(&self) -> &[Reference]

DictionaryRef children.

Source

pub fn add_dictionary_ref(&mut self, value: Reference)

DictionaryRef children.

Source

pub fn languages_of_creator(&self) -> &[Language]

LanguageOfCreator children.

Source

pub fn add_language_of_creator(&mut self, value: Language)

LanguageOfCreator children.

Source

pub fn countries_of_origin(&self) -> &[String]

CountryOfOrigin children.

Source

pub fn add_country_of_origin(&mut self, value: String)

CountryOfOrigin children.

Source

pub fn visual_representations(&self) -> &[Base64Binary]

VisualRepresentation children.

Source

pub fn add_visual_representation(&mut self, value: Base64Binary)

VisualRepresentation children.

Source

pub fn major_versions(&self) -> &[NonNegativeInteger]

MajorVersion children.

Source

pub fn add_major_version(&mut self, value: NonNegativeInteger)

MajorVersion children.

Source

pub fn minor_versions(&self) -> &[NonNegativeInteger]

MinorVersion children.

Source

pub fn add_minor_version(&mut self, value: NonNegativeInteger)

MinorVersion children.

Source

pub fn statuses(&self) -> &[String]

Status children.

Source

pub fn add_status(&mut self, value: String)

Status children.

Source

pub fn deprecation_explanations(&self) -> &[String]

DeprecationExplanation children.

Source

pub fn add_deprecation_explanation(&mut self, value: String)

DeprecationExplanation children.

Trait Implementations§

Source§

impl Clone for Concept

Source§

fn clone(&self) -> Concept

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Concept

Source§

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

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

impl Eq for Concept

Source§

impl PartialEq for Concept

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Concept

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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

Source§

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.