pub struct ConnectionInterface { /* private fields */ }Expand description
The reciprocal of ConnectionHandle.
Implementations§
Source§impl ConnectionInterface
impl ConnectionInterface
Sourcepub fn send_to_frontend(
&self,
item: PubSubItem,
) -> Result<(), SendError<PubSubItem>>
pub fn send_to_frontend( &self, item: PubSubItem, ) -> Result<(), SendError<PubSubItem>>
Send a pubsub item to the frontend.
Sourcepub async fn recv_from_frontend(&mut self) -> Option<Box<RawValue>>
pub async fn recv_from_frontend(&mut self) -> Option<Box<RawValue>>
Receive a request from the frontend. Ensures that if the frontend has dropped or issued a shutdown instruction, the backend sees no more requests.
Sourcepub fn close_with_error(self)
pub fn close_with_error(self)
Close the interface, signaling a generic backend-gone error to the frontend.
The pubsub service will attempt to reconnect using the configured
retry policy. Use Self::close_with_transport_error to opt out of
the reconnect loop on deterministic, non-retryable failures.
Sourcepub fn close_with_transport_error(self, err: TransportError)
pub fn close_with_transport_error(self, err: TransportError)
Close the interface, signaling a specific transport error to the frontend.
Use TransportErrorKind::non_retryable_str /
TransportErrorKind::non_retryable to construct an error that
short-circuits the pubsub service’s reconnect loop. Any other error
kind triggers the normal reconnect-with-retries path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionInterface
impl !UnwindSafe for ConnectionInterface
impl Freeze for ConnectionInterface
impl Send for ConnectionInterface
impl Sync for ConnectionInterface
impl Unpin for ConnectionInterface
impl UnsafeUnpin for ConnectionInterface
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
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> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes