final class ToPull[F[_], O] extends AnyVal
Projection of a Stream providing various ways to get a Pull from the Stream.
- Source
- Stream.scala
- Alphabetic
- By Inheritance
- ToPull
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
- def +(other: String): String
- def ->[B](y: B): (ToPull[F, O], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
drop(n: Long): Pull[F, INothing, Option[Stream[F, O]]]
Drops the first
nelements of thisStream, and returns the newStream. -
def
dropThrough(p: (O) ⇒ Boolean): Pull[F, INothing, Option[Stream[F, O]]]
Like dropWhile, but drops the first value which tests false.
-
def
dropWhile(p: (O) ⇒ Boolean): Pull[F, INothing, Option[Stream[F, O]]]
Drops elements of the this stream until the predicate
pfails, and returns the new stream.Drops elements of the this stream until the predicate
pfails, and returns the new stream. If defined, the first element of the returned stream will failp. -
def
echo: Pull[F, O, Unit]
Writes all inputs to the output of the returned
Pull. -
def
echo1: Pull[F, O, Option[Stream[F, O]]]
Reads a single element from the input and emits it to the output.
-
def
echoChunk: Pull[F, O, Option[Stream[F, O]]]
Reads the next available chunk from the input and emits it to the output.
- def ensuring(cond: (ToPull[F, O]) ⇒ Boolean, msg: ⇒ Any): ToPull[F, O]
- def ensuring(cond: (ToPull[F, O]) ⇒ Boolean): ToPull[F, O]
- def ensuring(cond: Boolean, msg: ⇒ Any): ToPull[F, O]
- def ensuring(cond: Boolean): ToPull[F, O]
-
def
fetchN(n: Int): Pull[F, INothing, Option[Stream[F, O]]]
Like
unconsN, but leaves the buffered input unconsumed. -
def
find(f: (O) ⇒ Boolean): Pull[F, INothing, Option[(O, Stream[F, O])]]
Awaits the next available element where the predicate returns true.
-
def
fold[O2](z: O2)(f: (O2, O) ⇒ O2): Pull[F, INothing, O2]
Folds all inputs using an initial value
zand supplied binary operator, and writes the final result to the output of the suppliedPullwhen the stream has no more values. -
def
fold1[O2 >: O](f: (O2, O2) ⇒ O2): Pull[F, INothing, Option[O2]]
Folds all inputs using the supplied binary operator, and writes the final result to the output of the supplied
Pullwhen the stream has no more values. -
def
forall(p: (O) ⇒ Boolean): Pull[F, INothing, Boolean]
Writes a single
truevalue if all input matches the predicate,falseotherwise. - def formatted(fmtstr: String): String
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last: Pull[F, INothing, Option[O]]
Returns the last element of the input, if non-empty.
-
def
peek: Pull[F, INothing, Option[(Chunk[O], Stream[F, O])]]
Like uncons but does not consume the chunk (i.e., the chunk is pushed back).
-
def
peek1: Pull[F, INothing, Option[(O, Stream[F, O])]]
Like uncons1 but does not consume the element (i.e., the element is pushed back).
-
def
scanChunks[S, O2](init: S)(f: (S, Chunk[O]) ⇒ (S, Chunk[O2])): Pull[F, O2, S]
Like
scanbutfis applied to each chunk of the source stream.Like
scanbutfis applied to each chunk of the source stream. The resulting chunk is emitted and the result of the chunk is used in the next invocation off. The final state value is returned as the result of the pull. -
def
scanChunksOpt[S, O2](init: S)(f: (S) ⇒ Option[(Chunk[O]) ⇒ (S, Chunk[O2])]): Pull[F, O2, S]
More general version of
scanChunkswhere the current state (i.e.,S) can be inspected to determine if another chunk should be pulled or if the pull should terminate.More general version of
scanChunkswhere the current state (i.e.,S) can be inspected to determine if another chunk should be pulled or if the pull should terminate. Termination is signaled by returningNonefromf. Otherwise, a function which consumes the next chunk is returned wrapped inSome. The final state value is returned as the result of the pull. -
def
stepLeg: Pull[F, INothing, Option[StepLeg[F, O]]]
Like
uncons, but instead of performing normaluncons, this will run the stream up to the first chunk available.Like
uncons, but instead of performing normaluncons, this will run the stream up to the first chunk available. Useful when zipping multiple streams (legs) into one stream. Assures that scopes are correctly held for each streamlegindependently of scopes from other legs.If you are not pulling from multiple streams, consider using
uncons. -
def
take(n: Long): Pull[F, O, Option[Stream[F, O]]]
Emits the first
nelements of the input. -
def
takeRight(n: Int): Pull[F, INothing, Queue[O]]
Emits the last
nelements of the input. -
def
takeThrough(p: (O) ⇒ Boolean): Pull[F, O, Option[Stream[F, O]]]
Like takeWhile, but emits the first value which tests false.
-
def
takeWhile(p: (O) ⇒ Boolean, takeFailure: Boolean = false): Pull[F, O, Option[Stream[F, O]]]
Emits the elements of the stream until the predicate
pfails, and returns the remainingStream.Emits the elements of the stream until the predicate
pfails, and returns the remainingStream. If non-empty, the returned stream will have a first elementifor whichp(i)isfalse. -
def
toString(): String
- Definition Classes
- Any
-
def
uncons: Pull[F, INothing, Option[(Chunk[O], Stream[F, O])]]
Waits for a chunk of elements to be available in the source stream.
Waits for a chunk of elements to be available in the source stream. The chunk of elements along with a new stream are provided as the resource of the returned pull. The new stream can be used for subsequent operations, like awaiting again. A
Noneis returned as the resource of the pull upon reaching the end of the stream. -
def
uncons1: Pull[F, INothing, Option[(O, Stream[F, O])]]
Like uncons but waits for a single element instead of an entire chunk.
-
def
unconsLimit(n: Int): Pull[F, INothing, Option[(Chunk[O], Stream[F, O])]]
Like uncons, but returns a chunk of no more than
nelements.Like uncons, but returns a chunk of no more than
nelements.Pull.pure(None)is returned if the end of the source stream is reached. -
def
unconsN(n: Int, allowFewer: Boolean = false): Pull[F, INothing, Option[(Chunk[O], Stream[F, O])]]
Like uncons, but returns a chunk of exactly
nelements, splitting chunk as necessary.Like uncons, but returns a chunk of exactly
nelements, splitting chunk as necessary.Pull.pure(None)is returned if the end of the source stream is reached. - def →[B](y: B): (ToPull[F, O], B)