pub enum TCStream {
Aggregate(Box<Aggregate>),
Collection(Collection),
Filter(Box<Filter>),
Flatten(Box<Flatten>),
Map(Box<Map>),
Range(Range),
}
Expand description
A stream generator such as a Collection
or a mapping or aggregation of its items
Variants
Aggregate(Box<Aggregate>)
Collection(Collection)
Filter(Box<Filter>)
Flatten(Box<Flatten>)
Map(Box<Map>)
Range(Range)
Implementations
sourceimpl TCStream
impl TCStream
sourcepub fn aggregate(self) -> Self
pub fn aggregate(self) -> Self
Group equal sequential items in this stream.
For example, aggregating the stream ['b', 'b', 'a', 'a', 'b']
will produce ['b', 'a', 'b']
.
sourcepub fn filter(self, filter: Closure) -> Self
pub fn filter(self, filter: Closure) -> Self
Return a new stream with only the elements in this stream which match the given filter
.
sourcepub async fn fold(
self,
txn: Txn,
item_name: Id,
state: Map<State>,
op: Closure
) -> TCResult<State>
pub async fn fold(
self,
txn: Txn,
item_name: Id,
state: Map<State>,
op: Closure
) -> TCResult<State>
Fold this stream with the given initial State
and Closure
.
For example, folding [1, 2, 3]
with 0
and Number::add
will produce 6
.
sourcepub async fn for_each(self, txn: &Txn, op: Closure) -> TCResult<()>
pub async fn for_each(self, txn: &Txn, op: Closure) -> TCResult<()>
Execute the given Closure
with each item in the stream as its args
.
sourcepub async fn hash(self, txn: Txn) -> TCResult<Output<Sha256>>
pub async fn hash(self, txn: Txn) -> TCResult<Output<Sha256>>
Compute the SHA256 hash of this TCStream
.
Trait Implementations
sourceimpl<T> From<T> for TCStream where
Collection: From<T>,
impl<T> From<T> for TCStream where
Collection: From<T>,
sourceimpl<'en> IntoView<'en, Dir> for TCStream
impl<'en> IntoView<'en, Dir> for TCStream
sourceimpl Source for TCStream
impl Source for TCStream
fn into_stream<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<TCBoxTryStream<'static, State>>> + Send + 'async_trait>> where
Self: 'async_trait,
sourceimpl TryCastFrom<State> for TCStream
impl TryCastFrom<State> for TCStream
sourcefn can_cast_from(state: &State) -> bool
fn can_cast_from(state: &State) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(state: State) -> Option<Self>
fn opt_cast_from(state: State) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
Auto Trait Implementations
impl !RefUnwindSafe for TCStream
impl Send for TCStream
impl Sync for TCStream
impl Unpin for TCStream
impl !UnwindSafe for TCStream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more