Skip to main content

InMemoryCrdtRuntime

Struct InMemoryCrdtRuntime 

Source
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

Source§

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>

Apply a local CRDT update (base64-encoded binary).
Source§

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>

Return a full snapshot of the document (base64-encoded).
Source§

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>

Destroy a room and release its resources.
Source§

fn drain_events(&self) -> Vec<HostPushEvent>

Drain queued push events destined for the SPA. Read more
Source§

impl Debug for InMemoryCrdtRuntime

Source§

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

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

impl Default for InMemoryCrdtRuntime

Source§

fn default() -> InMemoryCrdtRuntime

Returns the “default value” for a type. Read more

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> 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, 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.