Struct ValueStream
pub struct ValueStream { /* private fields */ }Implementations§
§impl ValueStream
impl ValueStream
pub fn from_value(value: impl Into<Value>) -> ValueStream
pub fn from_stream<T>(stream: T) -> ValueStream
pub fn from_vec(records: Vec<Value>) -> ValueStream
pub fn from_iter<T, I>(iter: I) -> ValueStream
pub async fn tap(&mut self) -> Result<(), Error>
pub async fn tap(&mut self) -> Result<(), Error>
Force the stream to preload at least one record, if there are more records to stream.
pub async fn collect(self) -> Result<Vec<Value>, Error>
pub async fn dup(&mut self) -> Result<ValueStream, Error>
pub fn try_clone(&self) -> Option<ValueStream>
pub async fn buffer(&mut self) -> Result<(), Error>
pub fn is_buffered(&self) -> bool
pub fn is_buffered(&self) -> bool
Returns true if the ValueStream is fully buffered (no remaining stream)
pub fn buffered_to_vec(&self) -> Vec<Value>
pub fn buffered_to_vec(&self) -> Vec<Value>
Returns a clone of only the currently buffered values Does not consume any stream data or wait for additional values
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Value>
pub fn typed(self, ty: Type) -> ValueStream
Trait Implementations§
§impl Debug for ValueStream
impl Debug for ValueStream
§impl Default for ValueStream
impl Default for ValueStream
§fn default() -> ValueStream
fn default() -> ValueStream
Returns the “default value” for a type. Read more
§impl From<Value> for ValueStream
impl From<Value> for ValueStream
§fn from(src: Value) -> ValueStream
fn from(src: Value) -> ValueStream
Converts to this type from the input type.
§impl From<Vec<Value>> for ValueStream
impl From<Vec<Value>> for ValueStream
§fn from(value: Vec<Value>) -> ValueStream
fn from(value: Vec<Value>) -> ValueStream
Converts to this type from the input type.
§impl Stream for ValueStream
impl Stream for ValueStream
§fn poll_next(
self: Pin<&mut ValueStream>,
cx: &mut Context<'_>,
) -> Poll<Option<<ValueStream as Stream>::Item>>
fn poll_next( self: Pin<&mut ValueStream>, cx: &mut Context<'_>, ) -> Poll<Option<<ValueStream as Stream>::Item>>
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None if the stream is exhausted. Read moreAuto Trait Implementations§
impl Freeze for ValueStream
impl !RefUnwindSafe for ValueStream
impl Send for ValueStream
impl !Sync for ValueStream
impl Unpin for ValueStream
impl !UnwindSafe for ValueStream
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<St> StreamExt for Stwhere
St: Stream + ?Sized,
impl<St> StreamExt for Stwhere
St: Stream + ?Sized,
§fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
Consumes and returns the next value in the stream or
None if the
stream is finished. Read more§fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
Consumes and returns the next item in the stream. If an error is
encountered before the next item, the error is returned instead. Read more
§fn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
Maps this stream’s items to a different type, returning a new stream of
the resulting type. Read more
§fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
Map this stream’s items to a different type for as long as determined by
the provided closure. A stream of the target type will be returned,
which will yield elements until the closure returns
None. Read more§fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
Maps this stream’s items asynchronously to a different type, returning a
new stream of the resulting type. Read more
§fn merge<U>(self, other: U) -> Merge<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
fn merge<U>(self, other: U) -> Merge<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
Combine two streams into one by interleaving the output of both as it
is produced. Read more
§fn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
Filters the values produced by this stream according to the provided
predicate. Read more
§fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
Filters the values produced by this stream while simultaneously mapping
them to a different type according to the provided closure. Read more
§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
Creates a stream which ends after the first
None. Read more§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Creates a new stream of at most
n items of the underlying stream. Read more§fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
Take elements from this stream while the provided predicate
resolves to
true. Read more§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Creates a new stream that will skip the
n first items of the
underlying stream. Read more§fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
Skip elements from the underlying stream while the provided predicate
resolves to
true. Read more§fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
Tests if every element of the stream matches a predicate. Read more
§fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
Tests if any element of the stream matches a predicate. Read more
§fn chain<U>(self, other: U) -> Chain<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
fn chain<U>(self, other: U) -> Chain<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
Combine two streams into one by first returning all values from the
first stream then all values from the second stream. Read more
§fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
A combinator that applies a function to every element in a stream
producing a single, final value. Read more