#[non_exhaustive]pub struct ConceptUpsert {
pub id: String,
pub title: String,
pub content: String,
pub embedding_model: Option<String>,
pub valid_from: String,
pub valid_to: String,
pub retired: bool,
pub branch: Option<BranchId>,
}Expand description
A concept assertion: the payload of an upsert.
#[non_exhaustive] since 0.14.8 for
EdgeAssertion’s reason: branch is the
first field added since it was written, and one break is better than a
recurring one.
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.id: String§title: String§content: String§embedding_model: Option<String>§valid_from: String§valid_to: String§retired: bool§branch: Option<BranchId>The lineage this concept is minted on, or None for the trunk (§15.2,
D-225).
The rule here is narrower than the edge’s, and it is the schema’s
rather than this crate’s. concepts is a current-state projection
keyed by identity — id is NOT NULL UNIQUE — so two lineages holding
different beliefs about one concept is two rows with one id, which the
unique index refuses on its own. trg_concepts_cross_lineage turns that
refusal into DbError::CrossLineage so it says which rule was broken.
So a branch inherits its parent’s concepts and cannot restate them; what this field is for is a concept the branch mints, which is the case the trunk has no row for. A branch that needs to disagree with its parent about a concept’s content is asking for the overlay design, which is deferred with its reopen trigger named (D-214).
Implementations§
Source§impl ConceptUpsert
impl ConceptUpsert
pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
pub fn content(self, content: impl Into<String>) -> Self
pub fn embedding_model(self, model: impl Into<String>) -> Self
pub fn valid_from(self, ts: impl Into<String>) -> Self
pub fn valid_to(self, ts: impl Into<String>) -> Self
Sourcepub fn on_branch(self, branch: BranchId) -> Self
pub fn on_branch(self, branch: BranchId) -> Self
Mint this concept on branch rather than on the trunk (0.14.8).
See branch for why a branch may mint a concept and may
not restate one it inherited.
pub fn retired(self, retired: bool) -> Self
Sourcepub fn normalized(self) -> Result<Self>
pub fn normalized(self) -> Result<Self>
Put the timestamps in canonical form (D-029) before they cross the channel.
Trait Implementations§
Source§impl Clone for ConceptUpsert
impl Clone for ConceptUpsert
Source§fn clone(&self) -> ConceptUpsert
fn clone(&self) -> ConceptUpsert
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConceptUpsert
impl Debug for ConceptUpsert
Source§impl PartialEq for ConceptUpsert
impl PartialEq for ConceptUpsert
impl StructuralPartialEq for ConceptUpsert
Auto Trait Implementations§
impl Freeze for ConceptUpsert
impl RefUnwindSafe for ConceptUpsert
impl Send for ConceptUpsert
impl Sync for ConceptUpsert
impl Unpin for ConceptUpsert
impl UnsafeUnpin for ConceptUpsert
impl UnwindSafe for ConceptUpsert
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request