pub struct NewExperienceRelation {
pub source_id: ExperienceId,
pub target_id: ExperienceId,
pub relation_type: RelationType,
pub strength: f32,
pub metadata: Option<String>,
}Expand description
Input for creating a new relation between two experiences.
§Example
use pulsedb::{NewExperienceRelation, RelationType};
let rel = NewExperienceRelation {
source_id: exp_a,
target_id: exp_b,
relation_type: RelationType::Supports,
strength: 0.9,
metadata: None,
};
let id = db.store_relation(rel)?;Fields§
§source_id: ExperienceIdThe experience this relation originates from.
target_id: ExperienceIdThe experience this relation points to.
relation_type: RelationTypeThe type of relationship.
strength: f32Strength of the relation (0.0 - 1.0).
metadata: Option<String>Optional JSON metadata (max 10KB).
Auto Trait Implementations§
impl Freeze for NewExperienceRelation
impl RefUnwindSafe for NewExperienceRelation
impl Send for NewExperienceRelation
impl Sync for NewExperienceRelation
impl Unpin for NewExperienceRelation
impl UnsafeUnpin for NewExperienceRelation
impl UnwindSafe for NewExperienceRelation
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more