pub struct NotificationDecoder { /* private fields */ }Expand description
A single response epoch. This validates the wire contract; HTTP security, actual server readiness, clocks and reconnection belong to the transport adapter.
Implementations§
Source§impl NotificationDecoder
impl NotificationDecoder
pub fn new( request: Arc<SubscriptionRequest>, expected_request_id: NotificationRequestId, timer_limits: TimerLimits, ) -> Result<Self, ProtocolError>
Sourcepub fn decode(&mut self, input: &[u8]) -> Result<DecodeStep, ProtocolError>
pub fn decode(&mut self, input: &[u8]) -> Result<DecodeStep, ProtocolError>
Returns zero consumed bytes only for empty input or a completed CR-delimited frame that was waiting to disambiguate its exact byte limit. In the latter case an event is returned, so callers can make progress without discarding input.
Sourcepub fn finish(&mut self) -> Result<Option<NotificationWireEvent>, ProtocolError>
pub fn finish(&mut self) -> Result<Option<NotificationWireEvent>, ProtocolError>
Call at EOF, then again if this returns an event. EOF can finalize a bare CR at the exact frame limit, but never dispatches an unterminated event. A live stream without a terminal frame ends with UnexpectedEnd.
pub fn ready(&self) -> Option<&NotificationReady>
pub fn is_terminal(&self) -> bool
Auto Trait Implementations§
impl Freeze for NotificationDecoder
impl RefUnwindSafe for NotificationDecoder
impl Send for NotificationDecoder
impl Sync for NotificationDecoder
impl Unpin for NotificationDecoder
impl UnsafeUnpin for NotificationDecoder
impl UnwindSafe for NotificationDecoder
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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