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
impl WriteRequestBuilder
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
Create a new builder with the given human-readable label.
Sourcepub 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
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.
Sourcepub fn retire_node(
&mut self,
logical_id: impl Into<NodeRef>,
source_ref: Option<String>,
)
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.
Sourcepub 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
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.
Sourcepub fn retire_edge(
&mut self,
logical_id: impl Into<EdgeRef>,
source_ref: Option<String>,
)
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.
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub fn add_optional_backfill(
&mut self,
target: ProjectionTarget,
payload: impl Into<String>,
)
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.
Sourcepub fn add_vec_insert(
&mut self,
chunk: impl Into<ChunkRef>,
embedding: Vec<f32>,
)
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.
Sourcepub fn add_operational_append(
&mut self,
collection: impl Into<String>,
record_key: impl Into<String>,
payload_json: impl Into<String>,
source_ref: Option<String>,
)
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).
Sourcepub fn add_operational_put(
&mut self,
collection: impl Into<String>,
record_key: impl Into<String>,
payload_json: impl Into<String>,
source_ref: Option<String>,
)
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.
Sourcepub fn add_operational_delete(
&mut self,
collection: impl Into<String>,
record_key: impl Into<String>,
source_ref: Option<String>,
)
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.
Sourcepub fn build(self) -> Result<WriteRequest, EngineError>
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
impl Clone for WriteRequestBuilder
Source§fn clone(&self) -> WriteRequestBuilder
fn clone(&self) -> WriteRequestBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more