pub struct Streamer<'a> { /* private fields */ }Expand description
Implements pagination on top of a SnapshotReceiver channel.
Implementations§
Source§impl<'a> Streamer<'a>
impl<'a> Streamer<'a>
Sourcepub fn new(dest: &'a mut SnapshotReceiverProxy) -> Streamer<'a>
pub fn new(dest: &'a mut SnapshotReceiverProxy) -> Streamer<'a>
Prepares to send a snapshot over the given channel.
Takes a mutable reference to be sure that nobody else can write into the channel at the same time.
Sourcepub async fn push_element(self, elem: SnapshotElement) -> Result<Self, Error>
pub async fn push_element(self, elem: SnapshotElement) -> Result<Self, Error>
Sends the given elem.
This method internally flushes the outgoing buffer, if necessary, so that it never exceeds the maximum allowed size.
Sourcepub async fn end_of_snapshot(self) -> Result<(), Error>
pub async fn end_of_snapshot(self) -> Result<(), Error>
Sends the end-of-snapshot marker.
Auto Trait Implementations§
impl<'a> Freeze for Streamer<'a>
impl<'a> !RefUnwindSafe for Streamer<'a>
impl<'a> Send for Streamer<'a>
impl<'a> Sync for Streamer<'a>
impl<'a> Unpin for Streamer<'a>
impl<'a> !UnwindSafe for Streamer<'a>
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