Skip to main content

WriteRequestBuilder

Struct WriteRequestBuilder 

Source
pub struct WriteRequestBuilder { /* private fields */ }
Expand description

Collects nodes, edges, chunks, runs, steps, actions, and operational writes into a validated WriteRequest.

Handles returned from add_* methods can be passed to later calls within the same builder, allowing forward references between co-submitted items.

Implementations§

Source§

impl WriteRequestBuilder

Source

pub fn new(label: impl Into<String>) -> Self

Create a new builder with the given human-readable label.

Source

pub fn add_node( &mut self, row_id: impl Into<String>, logical_id: impl Into<String>, kind: impl Into<String>, properties: impl Into<String>, source_ref: Option<String>, upsert: bool, chunk_policy: ChunkPolicy, content_ref: Option<String>, ) -> NodeHandle

Add a node insert to this write request and return its handle.

Source

pub fn retire_node( &mut self, logical_id: impl Into<NodeRef>, source_ref: Option<String>, )

Mark a node for retirement (soft-delete) in this write request.

Source

pub fn add_edge( &mut self, row_id: impl Into<String>, logical_id: impl Into<String>, source: impl Into<NodeRef>, target: impl Into<NodeRef>, kind: impl Into<String>, properties: impl Into<String>, source_ref: Option<String>, upsert: bool, ) -> EdgeHandle

Add an edge insert to this write request and return its handle.

Source

pub fn retire_edge( &mut self, logical_id: impl Into<EdgeRef>, source_ref: Option<String>, )

Mark an edge for retirement (soft-delete) in this write request.

Source

pub fn add_chunk( &mut self, id: impl Into<String>, node: impl Into<NodeRef>, text_content: impl Into<String>, byte_start: Option<i64>, byte_end: Option<i64>, content_hash: Option<String>, ) -> ChunkHandle

Add a text chunk attached to a node and return its handle.

Source

pub fn add_run( &mut self, id: impl Into<String>, kind: impl Into<String>, status: impl Into<String>, properties: impl Into<String>, source_ref: Option<String>, upsert: bool, supersedes_id: Option<String>, ) -> RunHandle

Add a run insert to this write request and return its handle.

Source

pub fn add_step( &mut self, id: impl Into<String>, run: impl Into<RunRef>, kind: impl Into<String>, status: impl Into<String>, properties: impl Into<String>, source_ref: Option<String>, upsert: bool, supersedes_id: Option<String>, ) -> StepHandle

Add a step insert to this write request and return its handle.

Source

pub fn add_action( &mut self, id: impl Into<String>, step: impl Into<StepRef>, kind: impl Into<String>, status: impl Into<String>, properties: impl Into<String>, source_ref: Option<String>, upsert: bool, supersedes_id: Option<String>, ) -> ActionHandle

Add an action insert to this write request and return its handle.

Source

pub fn add_optional_backfill( &mut self, target: ProjectionTarget, payload: impl Into<String>, )

Enqueue an optional projection backfill task to run after the write commits.

Source

pub fn add_vec_insert( &mut self, chunk: impl Into<ChunkRef>, embedding: Vec<f32>, )

Attach a vector embedding to a chunk in this write request.

Source

pub fn add_operational_append( &mut self, collection: impl Into<String>, record_key: impl Into<String>, payload_json: impl Into<String>, source_ref: Option<String>, )

Append a mutation to an operational collection (log-style, preserves history).

Source

pub fn add_operational_put( &mut self, collection: impl Into<String>, record_key: impl Into<String>, payload_json: impl Into<String>, source_ref: Option<String>, )

Put (upsert) a record into an operational collection, replacing any previous value.

Source

pub fn add_operational_delete( &mut self, collection: impl Into<String>, record_key: impl Into<String>, source_ref: Option<String>, )

Delete a record from an operational collection by key.

Source

pub fn build(self) -> Result<WriteRequest, EngineError>

Resolve all handles and produce a finalized WriteRequest.

§Errors

Returns EngineError::InvalidWrite if any handle references a different builder instance.

Trait Implementations§

Source§

impl Clone for WriteRequestBuilder

Source§

fn clone(&self) -> WriteRequestBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WriteRequestBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for WriteRequestBuilder

Source§

fn eq(&self, other: &WriteRequestBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for WriteRequestBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V