pub struct Subject { /* private fields */ }Expand description
Owned SubjectType core shared by object types, groups, and data templates.
SubjectType requires at least one HasPartRef or IsSubtypeOfRef
(a repeating choice with a minimum of one). new does not enforce this,
so check a built value with its codec’s schema validation before relying
on it.
Implementations§
Source§impl Subject
impl Subject
Sourcepub fn from_element(element: &Element) -> Result<Self, CodecError>
pub fn from_element(element: &Element) -> Result<Self, CodecError>
Decodes SubjectType content (any element name).
Source§impl Subject
impl Subject
pub const fn new(concept: Concept) -> Self
pub const fn concept(&self) -> &Concept
Sourcepub fn concept_mut(&mut self) -> &mut Concept
pub fn concept_mut(&mut self) -> &mut Concept
Mutable access to the shared ConceptType core.
pub fn has_part_refs(&self) -> &[Reference]
pub fn add_has_part_ref(&mut self, value: Reference)
Sourcepub fn is_subtype_of_refs(&self) -> &[Reference]
pub fn is_subtype_of_refs(&self) -> &[Reference]
IsSubtypeOfRef children; the schema permits any number.
pub fn add_is_subtype_of_ref(&mut self, value: Reference)
Sourcepub fn is_subtype_of_ref(&self) -> Option<&Reference>
👎Deprecated since 0.3.0: use is_subtype_of_refs
pub fn is_subtype_of_ref(&self) -> Option<&Reference>
use is_subtype_of_refs
The first IsSubtypeOfRef, when present.
Sourcepub fn set_is_subtype_of_ref(&mut self, value: Option<Reference>)
👎Deprecated since 0.3.0: use add_is_subtype_of_ref
pub fn set_is_subtype_of_ref(&mut self, value: Option<Reference>)
use add_is_subtype_of_ref
Replaces every IsSubtypeOfRef with value (none when None).
Trait Implementations§
impl Eq for Subject
impl StructuralPartialEq for Subject
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnsafeUnpin for Subject
impl UnwindSafe for Subject
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