pub struct RelaySessionHandle { /* private fields */ }Expand description
Thread-safe generated-binding owner for one serialized relay session.
Implementations§
Source§impl RelaySessionHandle
impl RelaySessionHandle
Sourcepub fn connect(&self) -> Result<RelaySessionAction, SoftchatError>
pub fn connect(&self) -> Result<RelaySessionAction, SoftchatError>
Begin a platform-owned WebSocket connection attempt.
§Errors
Returns a stable invalid-transition error.
Sourcepub fn transport_connected(&self) -> Result<(), SoftchatError>
pub fn transport_connected(&self) -> Result<(), SoftchatError>
Notify the session that the native transport is connected.
§Errors
Returns a stable invalid-transition error.
Sourcepub fn authenticated(&self) -> Result<(), SoftchatError>
pub fn authenticated(&self) -> Result<(), SoftchatError>
Mark relay authentication complete and replay retained intent.
§Errors
Returns a stable transition or bounded-queue error.
Sourcepub fn subscribe(
&self,
subscription_id: String,
filter_json: Vec<String>,
) -> Result<(), SoftchatError>
pub fn subscribe( &self, subscription_id: String, filter_json: Vec<String>, ) -> Result<(), SoftchatError>
Add or replace a subscription using strict filter JSON objects.
§Errors
Returns a stable filter, transition, or bounded-queue error.
Sourcepub fn close_subscription(
&self,
subscription_id: String,
) -> Result<(), SoftchatError>
pub fn close_subscription( &self, subscription_id: String, ) -> Result<(), SoftchatError>
Sourcepub fn publish(&self, events: Vec<SignedEvent>) -> Result<(), SoftchatError>
pub fn publish(&self, events: Vec<SignedEvent>) -> Result<(), SoftchatError>
Queue already-persisted authored events for delivery.
§Errors
Returns a stable validation, state, or queue error.
Sourcepub fn receive(
&self,
frame_json: String,
) -> Result<Vec<RelaySessionAction>, SoftchatError>
pub fn receive( &self, frame_json: String, ) -> Result<Vec<RelaySessionAction>, SoftchatError>
Consume one complete native WebSocket text frame.
§Errors
Returns a stable frame, correlation, state, or backpressure error.
Sourcepub fn confirm_ingested(&self, event_id: String) -> Result<(), SoftchatError>
pub fn confirm_ingested(&self, event_id: String) -> Result<(), SoftchatError>
Confirm an authoritative platform transaction handled an event.
§Errors
Returns a stable persistence-result error for unknown IDs.
Sourcepub fn transport_lost(&self) -> Result<Vec<RelaySessionAction>, SoftchatError>
pub fn transport_lost(&self) -> Result<Vec<RelaySessionAction>, SoftchatError>
Handle transport loss and return the reconnect plan.
§Errors
Returns a stable invalid-transition error.
Sourcepub fn drain_outbound(&self, limit: u32) -> Result<Vec<String>, SoftchatError>
pub fn drain_outbound(&self, limit: u32) -> Result<Vec<String>, SoftchatError>
Sourcepub fn snapshot(&self) -> RelaySessionSnapshot
pub fn snapshot(&self) -> RelaySessionSnapshot
Return one redacted serializable snapshot.
Sourcepub fn cancel(&self) -> RelaySessionAction
pub fn cancel(&self) -> RelaySessionAction
Permanently cancel the session and clear process-local queues.
Trait Implementations§
Source§impl Debug for RelaySessionHandle
impl Debug for RelaySessionHandle
Source§impl Default for RelaySessionHandle
impl Default for RelaySessionHandle
Source§impl<UT> LiftRef<UT> for RelaySessionHandle
impl<UT> LiftRef<UT> for RelaySessionHandle
type LiftType = Arc<RelaySessionHandle>
Source§impl<UT> LowerError<UT> for RelaySessionHandle
impl<UT> LowerError<UT> for RelaySessionHandle
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for RelaySessionHandle
impl<UT> LowerReturn<UT> for RelaySessionHandle
Source§type ReturnType = <Arc<RelaySessionHandle> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<RelaySessionHandle> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for RelaySessionHandle
impl<UT> TypeId<UT> for RelaySessionHandle
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !Freeze for RelaySessionHandle
impl RefUnwindSafe for RelaySessionHandle
impl Send for RelaySessionHandle
impl Sync for RelaySessionHandle
impl Unpin for RelaySessionHandle
impl UnsafeUnpin for RelaySessionHandle
impl UnwindSafe for RelaySessionHandle
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more