Skip to main content

InMemoryMeshRuntime

Struct InMemoryMeshRuntime 

Source
pub struct InMemoryMeshRuntime { /* private fields */ }

Implementations§

Source§

impl InMemoryMeshRuntime

Source

pub fn new() -> Self

Source

pub fn with_config(config: InMemoryMeshConfig) -> Self

Source

pub fn session_nonce(&self) -> &str

Returns the session nonce used for request ID generation.

Source

pub fn insert_pending_query(&self, request_id: &str)

Test helper: insert a request ID into pending queries.

Useful for testing respond() without going through request(), which auto-resolves and clears pending state.

Source

pub fn has_suppress_previews(&self, path: &str) -> bool

Test helper: check whether an object at the given path has suppress_previews set.

Trait Implementations§

Source§

impl Debug for InMemoryMeshRuntime

Source§

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

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

impl Default for InMemoryMeshRuntime

Source§

fn default() -> Self

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

impl MeshRuntime for InMemoryMeshRuntime

Source§

fn respond(&self, request_id: &str, data_base64: &str) -> bool

Marks a pending query as answered. Returns true if the request was pending, emitting a meshReply event with the response data.

This matches the contract of request(), which always emits meshReply — callers can rely on drain_events() to observe responses regardless of configuration.

Source§

fn publish(&self, topic: &str, data_base64: &str) -> bool

Source§

fn subscribe(&self, topic: &str) -> bool

Source§

fn put_object( &self, path: &str, data_base64: &str, policy: MeshObjectPolicy, ) -> bool

Source§

fn get_object_result(&self, path: &str) -> MeshObjectResult

Source§

fn request(&self, path: &str, data_base64: &str) -> String

Source§

fn status(&self) -> MeshStatusResult

Source§

fn supports_private(&self) -> bool

Source§

fn put_private_object( &self, data_base64: &str, policy: MeshObjectPolicy, ) -> MeshPrivateObjectRef

Source§

fn get_private_object_result( &self, handle: &str, capability: &str, ) -> MeshObjectResult

Source§

fn request_private( &self, handle: &str, capability: &str, _data_base64: &str, ) -> String

Source§

fn publish_private_control( &self, capability: &str, envelope: MeshControlEnvelope, ) -> bool

Source§

fn subscribe_private_control(&self, capability: &str) -> bool

Source§

fn publish_private_receipt(&self, capability: &str, data_base64: &str) -> bool

Source§

fn subscribe_private_receipt(&self, capability: &str) -> bool

Source§

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

Source§

fn get_object(&self, path: &str) -> Option<String>

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.