#[non_exhaustive]pub struct ObjectHeader {
pub summary: ObjectSummary,
pub title: Option<String>,
pub originator: Option<String>,
pub creation: Option<String>,
pub last_update: Option<String>,
pub format: Option<String>,
pub object_version: Option<String>,
pub schema_version: Option<String>,
}Expand description
Level 2: the identity, plus what a citation carries.
Everything here comes from the first few hundred bytes of a part. Nothing below the citation is parsed.
Built with ObjectHeader::new; #[non_exhaustive] (see Dataspace).
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.summary: ObjectSummaryLevel 1.
title: Option<String>Citation.Title - the name a user recognises.
originator: Option<String>Who or what produced the object.
creation: Option<String>Creation timestamp, in its lexical form.
last_update: Option<String>Last update timestamp, in its lexical form.
format: Option<String>The producing software, as it named itself.
object_version: Option<String>objectVersion, when the object carries one.
schema_version: Option<String>Schema version as written in the document, e.g. 2.0.
Implementations§
Source§impl ObjectHeader
impl ObjectHeader
Sourcepub fn new(summary: ObjectSummary) -> Self
pub fn new(summary: ObjectSummary) -> Self
The header of an object whose citation is not known yet: every field of it unset.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
With a title.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Title, or the uuid when the citation has none - a UI needs something to show, and an empty row is worse than a technical one.
Sourcepub fn titled(&self) -> String
pub fn titled(&self) -> String
The title (the uuid when there is none) followed by (version N) when
the object declares a non-blank objectVersion - what a column that
already has its own type column shows. The same rule as Self::label.
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
What a view shows of the object: type - title (version N), the
version only when the object declares a non-blank one -
energyml_core::identity::ObjectId::label, the one spelling every
face uses. The qualified type alone when it cannot be parsed.
Trait Implementations§
Source§impl Clone for ObjectHeader
impl Clone for ObjectHeader
Source§impl Debug for ObjectHeader
impl Debug for ObjectHeader
impl Eq for ObjectHeader
Source§impl PartialEq for ObjectHeader
impl PartialEq for ObjectHeader
impl StructuralPartialEq for ObjectHeader
Auto Trait Implementations§
impl Freeze for ObjectHeader
impl RefUnwindSafe for ObjectHeader
impl Send for ObjectHeader
impl Sync for ObjectHeader
impl Unpin for ObjectHeader
impl UnsafeUnpin for ObjectHeader
impl UnwindSafe for ObjectHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.