pub struct OpenStreamReceiver { /* private fields */ }Expand description
Transport-facing CEP-41 receiver wrapping a per-peer registry.
Implementations§
Source§impl OpenStreamReceiver
impl OpenStreamReceiver
Sourcepub fn with_policy(policy: OpenStreamRegistryPolicy) -> Self
pub fn with_policy(policy: OpenStreamRegistryPolicy) -> Self
Create a receiver with an explicit registry policy.
Sourcepub fn is_open_stream_frame(notification: &JsonRpcNotification) -> bool
pub fn is_open_stream_frame(notification: &JsonRpcNotification) -> bool
Returns true when notification carries a CEP-41 frame in params.cvm.
Sourcepub async fn process_frame(
&mut self,
notification: &JsonRpcNotification,
) -> Result<FrameOutcome, OpenStreamError>
pub async fn process_frame( &mut self, notification: &JsonRpcNotification, ) -> Result<FrameOutcome, OpenStreamError>
Feed one inbound notifications/progress frame to the registry, stamping
liveness with the real clock.
Sourcepub fn get_session(&self, progress_token: &str) -> Option<OpenStreamSession>
pub fn get_session(&self, progress_token: &str) -> Option<OpenStreamSession>
Look up an active reader session by token.
Sourcepub fn active_stream_count(&self) -> usize
pub fn active_stream_count(&self) -> usize
Number of active streams.
Sourcepub fn registry(&self) -> &OpenStreamRegistry
pub fn registry(&self) -> &OpenStreamRegistry
Borrow the underlying registry (e.g. to create an outbound reader session or drive the keepalive sweep).
Sourcepub fn registry_mut(&mut self) -> &mut OpenStreamRegistry
pub fn registry_mut(&mut self) -> &mut OpenStreamRegistry
Mutably borrow the underlying registry.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OpenStreamReceiver
impl !Sync for OpenStreamReceiver
impl !UnwindSafe for OpenStreamReceiver
impl Freeze for OpenStreamReceiver
impl Send for OpenStreamReceiver
impl Unpin for OpenStreamReceiver
impl UnsafeUnpin for OpenStreamReceiver
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more