pub struct RecordDraft {Show 13 fields
pub kind: RecordKind,
pub title: String,
pub summary: Option<String>,
pub body: Option<String>,
pub published_at: Option<Timestamp>,
pub effective_from: Option<Timestamp>,
pub effective_until: Option<Timestamp>,
pub observed_at: Option<Timestamp>,
pub actors: Vec<ActorRole>,
pub sources: Vec<SourceRef>,
pub relations: Vec<RelationDraft>,
pub visibility: Visibility,
pub extensions: BTreeMap<String, ExtensionData>,
}Expand description
Input for creating a record. The repository assigns the id, version and recorded time; clients cannot supply them.
Fields§
§kind: RecordKind§title: String§summary: Option<String>§body: Option<String>§published_at: Option<Timestamp>§effective_from: Option<Timestamp>§effective_until: Option<Timestamp>§observed_at: Option<Timestamp>§actors: Vec<ActorRole>§sources: Vec<SourceRef>§relations: Vec<RelationDraft>§visibility: Visibility§extensions: BTreeMap<String, ExtensionData>Implementations§
Source§impl RecordDraft
impl RecordDraft
pub fn new(kind: RecordKind, title: impl Into<String>) -> Self
pub fn summary(self, s: impl Into<String>) -> Self
pub fn body(self, s: impl Into<String>) -> Self
pub fn actor(self, role: ActorRoleKind, attribution: Attribution) -> Self
pub fn source(self, source: SourceRef) -> Self
pub fn relation(self, relation: RelationDraft) -> Self
pub fn visibility(self, v: Visibility) -> Self
pub fn extension( self, namespace: &str, version: SchemaVersion, fields: BTreeMap<String, ExtValue>, ) -> Self
Trait Implementations§
Source§impl Clone for RecordDraft
impl Clone for RecordDraft
Source§fn clone(&self) -> RecordDraft
fn clone(&self) -> RecordDraft
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RecordDraft
impl Debug for RecordDraft
Source§impl<'de> Deserialize<'de> for RecordDraft
impl<'de> Deserialize<'de> for RecordDraft
Source§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
Source§impl PartialEq for RecordDraft
impl PartialEq for RecordDraft
Source§impl Serialize for RecordDraft
impl Serialize for RecordDraft
impl StructuralPartialEq for RecordDraft
Auto Trait Implementations§
impl Freeze for RecordDraft
impl RefUnwindSafe for RecordDraft
impl Send for RecordDraft
impl Sync for RecordDraft
impl Unpin for RecordDraft
impl UnsafeUnpin for RecordDraft
impl UnwindSafe for RecordDraft
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