pub struct ReposStream {
info: Option<Bytes>,
producer: Weak<Inner>,
stream: u64,
after: u64,
published: Receiver<u64>,
exclude: Exclusions,
lagged: u64,
closing: Receiver<bool>,
}Expand description
One consumer’s stream: the replay, then whatever arrives live, both read from the replay buffer.
A plain reader rather than a Stream, because a WebSocket is written to
rather than polled from — see routes::subscribe_repos.
Fields§
§info: Option<Bytes>The #info OutdatedCursor frame to send before anything else.
producer: Weak<Inner>Held weakly, so a stream does not keep a dropped producer alive.
stream: u64This stream’s key in Ring::streams.
after: u64The highest sequence number this stream has sent or passed over. It
sends the buffer’s frames after this one. Copied to Ring::streams
whenever it moves.
published: Receiver<u64>Changes whenever a frame is buffered.
exclude: ExclusionsWhich message types this consumer asked not to be sent.
lagged: u64How many sequence numbers the buffer evicted before this consumer was sent them.
closing: Receiver<bool>Whether the producer is closing. See Repos::close.
Implementations§
Source§impl ReposStream
impl ReposStream
Sourcepub async fn next(&mut self) -> Option<Bytes>
pub async fn next(&mut self) -> Option<Bytes>
The next frame’s bytes, or None when the producer is gone, or is
closing and this stream has sent what it was published.
A consumer the buffer evicted a frame from before it was sent is
dropped rather than silently skipped: the lexicon has
ConsumerTooSlow for exactly this, and a stream that resumed after a
gap would leave a relay believing it had seen every commit.
Trait Implementations§
Source§impl Debug for ReposStream
impl Debug for ReposStream
Source§impl Drop for ReposStream
Gives back the frames this stream was keeping in the buffer.
impl Drop for ReposStream
Gives back the frames this stream was keeping in the buffer.
Auto Trait Implementations§
impl !Freeze for ReposStream
impl !RefUnwindSafe for ReposStream
impl Send for ReposStream
impl Sync for ReposStream
impl Unpin for ReposStream
impl UnsafeUnpin for ReposStream
impl !UnwindSafe for ReposStream
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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