pub struct EventStreamBytes<S> { /* private fields */ }Expand description
Like EventStream but specialised for streams of Bytes.
Implementations§
Source§impl<S> EventStreamBytes<S>
impl<S> EventStreamBytes<S>
Sourcepub fn new(stream: S) -> Self
pub fn new(stream: S) -> Self
Create a new EventStreamBytes from a stream of Bytes.
Sourcepub fn set_last_event_id(&mut self, id: impl Into<Str>)
pub fn set_last_event_id(&mut self, id: impl Into<Str>)
Set the last event id, useful for resumability
Sourcepub fn last_event_id(&self) -> &Str
pub fn last_event_id(&self) -> &Str
Reference to the last event id given out by this stream
Sourcepub fn take_buffers(self) -> (BytesMut, Bytes)
pub fn take_buffers(self) -> (BytesMut, Bytes)
Takes the buffer and the remainder
Trait Implementations§
Source§impl<S: Debug> Debug for EventStreamBytes<S>
impl<S: Debug> Debug for EventStreamBytes<S>
Source§impl<S, E> Stream for EventStreamBytes<S>
impl<S, E> Stream for EventStreamBytes<S>
impl<'__pin, S> Unpin for EventStreamBytes<S>where
PinnedFieldsOf<__Origin<'__pin, S>>: Unpin,
Auto Trait Implementations§
impl<S> !Freeze for EventStreamBytes<S>
impl<S> RefUnwindSafe for EventStreamBytes<S>where
S: RefUnwindSafe,
impl<S> Send for EventStreamBytes<S>where
S: Send,
impl<S> Sync for EventStreamBytes<S>where
S: Sync,
impl<S> UnsafeUnpin for EventStreamBytes<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for EventStreamBytes<S>where
S: UnwindSafe,
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> 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