Skip to main content

PatchSink

Trait PatchSink 

Source
pub trait PatchSink {
    // Required methods
    fn add_triple(
        &mut self,
        subject: &str,
        predicate: &str,
        object: &str,
    ) -> Result<()>;
    fn remove_triple(
        &mut self,
        subject: &str,
        predicate: &str,
        object: &str,
    ) -> Result<()>;
    fn add_graph(&mut self, graph: &str) -> Result<()>;
    fn delete_graph(&mut self, graph: &str) -> Result<()>;
    fn add_prefix(&mut self, prefix: &str, namespace: &str) -> Result<()>;
    fn remove_prefix(&mut self, prefix: &str) -> Result<()>;
    fn begin_transaction(&mut self, transaction_id: Option<&str>) -> Result<()>;
    fn commit_transaction(&mut self) -> Result<()>;
    fn abort_transaction(&mut self) -> Result<()>;

    // Provided method
    fn header(&mut self, _key: &str, _value: &str) -> Result<()> { ... }
}
Expand description

A destination that RDF Patch operations can be applied to.

This is the seam between the patch engine and a concrete RDF store. Callers that want a patch to actually mutate a dataset implement this trait (or use the real store integration in crate::store_integration) and pass it to apply_patch_to_sink. Implementations should return Err when an operation cannot be applied so that the error is surfaced rather than silently swallowed.

Required Methods§

Source

fn add_triple( &mut self, subject: &str, predicate: &str, object: &str, ) -> Result<()>

Source

fn remove_triple( &mut self, subject: &str, predicate: &str, object: &str, ) -> Result<()>

Source

fn add_graph(&mut self, graph: &str) -> Result<()>

Source

fn delete_graph(&mut self, graph: &str) -> Result<()>

Source

fn add_prefix(&mut self, prefix: &str, namespace: &str) -> Result<()>

Source

fn remove_prefix(&mut self, prefix: &str) -> Result<()>

Source

fn begin_transaction(&mut self, transaction_id: Option<&str>) -> Result<()>

Source

fn commit_transaction(&mut self) -> Result<()>

Source

fn abort_transaction(&mut self) -> Result<()>

Provided Methods§

Source

fn header(&mut self, _key: &str, _value: &str) -> Result<()>

Handle a header operation. Headers are metadata and default to a no-op.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§