pub struct BidirectionalSync { /* private fields */ }Expand description
Periodic bidirectional sync orchestrator.
Implementations§
Source§impl BidirectionalSync
impl BidirectionalSync
Sourcepub fn new(config: BidirectionalSyncConfig) -> Self
pub fn new(config: BidirectionalSyncConfig) -> Self
Build a new orchestrator from config.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Convenience constructor with default configuration.
Sourcepub fn writer(&self) -> &StateToRdfWriter
pub fn writer(&self) -> &StateToRdfWriter
Read-only access to the embedded writer (e.g. for inspecting the configured prefix in tests).
Sourcepub fn ready(&self) -> bool
pub fn ready(&self) -> bool
Returns true when the configured interval has elapsed since the
last sync.
Sourcepub fn push_state(
&mut self,
state: &PhysicsState,
) -> PhysicsResult<BidirectionalSyncReport>
pub fn push_state( &mut self, state: &PhysicsState, ) -> PhysicsResult<BidirectionalSyncReport>
Push the supplied state to RDF, returning the SPARQL query the
caller should execute. The very first call returns a full snapshot
(when initial_full_snapshot is true), subsequent calls return only
diffs.
Returns SyncDirection::Skipped when the configured interval has
not yet elapsed.
§Errors
Returns PhysicsError::Internal when the supplied state is
malformed (empty entity IRI).
Sourcepub fn pull_state<F>(
&mut self,
entity_iri: &str,
step: u64,
fetch_rows: F,
) -> PhysicsResult<BidirectionalSyncReport>
pub fn pull_state<F>( &mut self, entity_iri: &str, step: u64, fetch_rows: F, ) -> PhysicsResult<BidirectionalSyncReport>
Pull the most recent property rows for entity_iri at step from
the supplied closure and re-extract a PhysicsState.
§Errors
Bubbles up any error returned by fetch_rows and any failure from
the inner extractor.
Auto Trait Implementations§
impl Freeze for BidirectionalSync
impl RefUnwindSafe for BidirectionalSync
impl Send for BidirectionalSync
impl Sync for BidirectionalSync
impl Unpin for BidirectionalSync
impl UnsafeUnpin for BidirectionalSync
impl UnwindSafe for BidirectionalSync
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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