pub struct InMemoryCrdtRuntime { /* private fields */ }Expand description
Minimal in-memory CRDT runtime for testing and headless-host scenarios.
This implementation does not perform real CRDT merge/encoding. Updates
are stored as opaque base64 strings and returned verbatim. State vectors
are represented as simple update counts. Production hosts must inject a
real CRDT backend (e.g., Yjs/y-crdt over Statement Store relay) via
CrdtExtension::with_runtime.
Implementations§
Trait Implementations§
Source§impl CrdtRuntime for InMemoryCrdtRuntime
impl CrdtRuntime for InMemoryCrdtRuntime
Source§fn join(
&self,
room_id: &str,
transport: &str,
) -> Result<CrdtJoinResult, CrdtRuntimeError>
fn join( &self, room_id: &str, transport: &str, ) -> Result<CrdtJoinResult, CrdtRuntimeError>
Join (or create) a room. Returns a
CrdtJoinResult.Source§fn apply_update(
&self,
room_id: &str,
update_base64: &str,
) -> Result<bool, CrdtRuntimeError>
fn apply_update( &self, room_id: &str, update_base64: &str, ) -> Result<bool, CrdtRuntimeError>
Apply a local CRDT update (base64-encoded binary).
Source§fn get_state_vector(&self, room_id: &str) -> Result<String, CrdtRuntimeError>
fn get_state_vector(&self, room_id: &str) -> Result<String, CrdtRuntimeError>
Return the current state vector (base64-encoded).
Source§fn get_full_state(&self, room_id: &str) -> Result<String, CrdtRuntimeError>
fn get_full_state(&self, room_id: &str) -> Result<String, CrdtRuntimeError>
Return a full snapshot of the document (base64-encoded).
Source§fn set_awareness(
&self,
room_id: &str,
awareness_state: &str,
) -> Result<bool, CrdtRuntimeError>
fn set_awareness( &self, room_id: &str, awareness_state: &str, ) -> Result<bool, CrdtRuntimeError>
Set ephemeral awareness/presence state (JSON string).
Source§fn destroy(&self, room_id: &str) -> Result<bool, CrdtRuntimeError>
fn destroy(&self, room_id: &str) -> Result<bool, CrdtRuntimeError>
Destroy a room and release its resources.
Source§fn drain_events(&self) -> Vec<HostPushEvent>
fn drain_events(&self) -> Vec<HostPushEvent>
Drain queued push events destined for the SPA. Read more
Source§impl Debug for InMemoryCrdtRuntime
impl Debug for InMemoryCrdtRuntime
Source§impl Default for InMemoryCrdtRuntime
impl Default for InMemoryCrdtRuntime
Source§fn default() -> InMemoryCrdtRuntime
fn default() -> InMemoryCrdtRuntime
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryCrdtRuntime
impl RefUnwindSafe for InMemoryCrdtRuntime
impl Send for InMemoryCrdtRuntime
impl Sync for InMemoryCrdtRuntime
impl Unpin for InMemoryCrdtRuntime
impl UnsafeUnpin for InMemoryCrdtRuntime
impl UnwindSafe for InMemoryCrdtRuntime
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