ZSink

zio.stream.ZSink
See theZSink companion object
final class ZSink[-R, +E, -In, +L, +Z] extends AnyVal

Attributes

Companion
object
Source
ZSink.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any
Self type
ZSink[R, E, In, L, Z]

Members list

Value members

Concrete methods

def &>[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Operator alias for zipParRight.

Operator alias for zipParRight.

Attributes

Source
ZSink.scala
def *>[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Operator alias for zipRight.

Operator alias for zipRight.

Attributes

Source
ZSink.scala
def <&[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z]

Operator alias for zipParLeft.

Operator alias for zipParLeft.

Attributes

Source
ZSink.scala
def <&>[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit zippable: Zippable[Z, Z1], trace: Trace): ZSink[R1, E1, In1, L1, zippable.Out]

Operator alias for zipPar.

Operator alias for zipPar.

Attributes

Source
ZSink.scala
def <*[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z]

Operator alias for zipLeft.

Operator alias for zipLeft.

Attributes

Source
ZSink.scala
def <*>[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit zippable: Zippable[Z, Z1], ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, zippable.Out]

Operator alias for zip.

Operator alias for zip.

Attributes

Source
ZSink.scala
def as[Z2](z: => Z2)(implicit trace: Trace): ZSink[R, E, In, L, Z2]

Replaces this sink's result with the provided value.

Replaces this sink's result with the provided value.

Attributes

Source
ZSink.scala
def collectAll(implicit ev: L <:< In, trace: Trace): ZSink[R, E, In, L, Chunk[Z]]

Repeatedly runs the sink and accumulates its results into a chunk

Repeatedly runs the sink and accumulates its results into a chunk

Attributes

Source
ZSink.scala
def collectAllWhileWith[S](z: => S)(p: Z => Boolean)(f: (S, Z) => S)(implicit ev: L <:< In, trace: Trace): ZSink[R, E, In, L, S]

Repeatedly runs the sink for as long as its results satisfy the predicate p. The sink's results will be accumulated using the stepping function f.

Repeatedly runs the sink for as long as its results satisfy the predicate p. The sink's results will be accumulated using the stepping function f.

Attributes

Source
ZSink.scala
def collectLeftover(implicit trace: Trace): ZSink[R, E, In, Nothing, (Z, Chunk[L])]

Collects the leftovers from the stream when the sink succeeds and returns them as part of the sink's result

Collects the leftovers from the stream when the sink succeeds and returns them as part of the sink's result

Attributes

Source
ZSink.scala
def contramap[In1](f: In1 => In)(implicit trace: Trace): ZSink[R, E, In1, L, Z]

Transforms this sink's input elements.

Transforms this sink's input elements.

Attributes

Source
ZSink.scala
def contramapChunks[In1](f: (Chunk[In1]) => Chunk[In])(implicit trace: Trace): ZSink[R, E, In1, L, Z]

Transforms this sink's input chunks. f must preserve chunking-invariance

Transforms this sink's input chunks. f must preserve chunking-invariance

Attributes

Source
ZSink.scala
def contramapChunksZIO[R1 <: R, E1 >: E, In1](f: (Chunk[In1]) => ZIO[R1, E1, Chunk[In]])(implicit trace: Trace): ZSink[R1, E1, In1, L, Z]

Effectfully transforms this sink's input chunks. f must preserve chunking-invariance

Effectfully transforms this sink's input chunks. f must preserve chunking-invariance

Attributes

Source
ZSink.scala
def contramapZIO[R1 <: R, E1 >: E, In1](f: In1 => ZIO[R1, E1, In])(implicit trace: Trace): ZSink[R1, E1, In1, L, Z]

Effectfully transforms this sink's input elements.

Effectfully transforms this sink's input elements.

Attributes

Source
ZSink.scala
def dimap[In1, Z1](f: In1 => In, g: Z => Z1)(implicit trace: Trace): ZSink[R, E, In1, L, Z1]

Transforms both inputs and result of this sink using the provided functions.

Transforms both inputs and result of this sink using the provided functions.

Attributes

Source
ZSink.scala
def dimapChunks[In1, Z1](f: (Chunk[In1]) => Chunk[In], g: Z => Z1)(implicit trace: Trace): ZSink[R, E, In1, L, Z1]

Transforms both input chunks and result of this sink using the provided functions.

Transforms both input chunks and result of this sink using the provided functions.

Attributes

Source
ZSink.scala
def dimapChunksZIO[R1 <: R, E1 >: E, In1, Z1](f: (Chunk[In1]) => ZIO[R1, E1, Chunk[In]], g: Z => ZIO[R1, E1, Z1])(implicit trace: Trace): ZSink[R1, E1, In1, L, Z1]

Effectfully transforms both input chunks and result of this sink using the provided functions. f and g must preserve chunking-invariance

Effectfully transforms both input chunks and result of this sink using the provided functions. f and g must preserve chunking-invariance

Attributes

Source
ZSink.scala
def dimapZIO[R1 <: R, E1 >: E, In1, Z1](f: In1 => ZIO[R1, E1, In], g: Z => ZIO[R1, E1, Z1])(implicit trace: Trace): ZSink[R1, E1, In1, L, Z1]

Effectfully transforms both inputs and result of this sink using the provided functions.

Effectfully transforms both inputs and result of this sink using the provided functions.

Attributes

Source
ZSink.scala
final def ensuring[R1 <: R](finalizer: => URIO[R1, Any])(implicit trace: Trace): ZSink[R1, E, In, L, Z]

Returns a new sink with an attached finalizer. The finalizer is guaranteed to be executed so long as the sink begins execution (and regardless of whether or not it completes).

Returns a new sink with an attached finalizer. The finalizer is guaranteed to be executed so long as the sink begins execution (and regardless of whether or not it completes).

Attributes

Source
ZSink.scala
final def ensuringWith[R1 <: R](finalizer: (Exit[Any, Any]) => URIO[R1, Any])(implicit trace: Trace): ZSink[R1, E, In, L, Z]

Returns a new sink with an attached finalizer. The finalizer is guaranteed to be executed so long as the sink begins execution (and regardless of whether or not it completes).

Returns a new sink with an attached finalizer. The finalizer is guaranteed to be executed so long as the sink begins execution (and regardless of whether or not it completes).

Attributes

Source
ZSink.scala
def filterInput[In1 <: In](p: In1 => Boolean)(implicit trace: Trace): ZSink[R, E, In1, L, Z]

Filters the sink's input with the given predicate

Filters the sink's input with the given predicate

Attributes

Source
ZSink.scala
def filterInputZIO[R1 <: R, E1 >: E, In1 <: In](p: In1 => ZIO[R1, E1, Boolean])(implicit trace: Trace): ZSink[R1, E1, In1, L, Z]

Filters the sink's input with the given ZIO predicate

Filters the sink's input with the given ZIO predicate

Attributes

Source
ZSink.scala
def findZIO[R1 <: R, E1 >: E](f: Z => ZIO[R1, E1, Boolean])(implicit ev: L <:< In, trace: Trace): ZSink[R1, E1, In, L, Option[Z]]

Creates a sink that produces values until one verifies the predicate f.

Creates a sink that produces values until one verifies the predicate f.

Attributes

Source
ZSink.scala
def flatMap[R1 <: R, E1 >: E, In1 <: In, L1 >: L <: In1, Z1](f: Z => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Runs this sink until it yields a result, then uses that result to create another sink from the provided function which will continue to run until it yields a result.

Runs this sink until it yields a result, then uses that result to create another sink from the provided function which will continue to run until it yields a result.

This function essentially runs sinks in sequence.

Attributes

Source
ZSink.scala
def foldCauseSink[R1 <: R, E2, In1 <: In, L1 >: L <: In1, Z1](failure: (Cause[E]) => ZSink[R1, E2, In1, L1, Z1], success: Z => ZSink[R1, E2, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E2, In1, L1, Z1]

Attributes

Source
ZSink.scala
def foldSink[R1 <: R, E2, In1 <: In, L1 >: L <: In1, Z1](failure: E => ZSink[R1, E2, In1, L1, Z1], success: Z => ZSink[R1, E2, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E2, In1, L1, Z1]

Folds over the result of the sink

Folds over the result of the sink

Attributes

Source
ZSink.scala
def ignoreLeftover(implicit trace: Trace): ZSink[R, E, In, Nothing, Z]

Drains the remaining elements from the stream after the sink finishes

Drains the remaining elements from the stream after the sink finishes

Attributes

Source
ZSink.scala
def map[Z2](f: Z => Z2)(implicit trace: Trace): ZSink[R, E, In, L, Z2]

Transforms this sink's result.

Transforms this sink's result.

Attributes

Source
ZSink.scala
def mapError[E2](f: E => E2)(implicit trace: Trace): ZSink[R, E2, In, L, Z]

Transforms the errors emitted by this sink using f.

Transforms the errors emitted by this sink using f.

Attributes

Source
ZSink.scala
def mapErrorCause[E2](f: (Cause[E]) => Cause[E2])(implicit trace: Trace): ZSink[R, E2, In, L, Z]

Transforms the full causes of failures emitted by this sink.

Transforms the full causes of failures emitted by this sink.

Attributes

Source
ZSink.scala
def mapErrorZIO[R1 <: R, E2](f: E => URIO[R1, E2])(implicit trace: Trace): ZSink[R1, E2, In, L, Z]

Transforms the errors emitted by this sink using f.

Transforms the errors emitted by this sink using f.

Attributes

Source
ZSink.scala
def mapLeftover[L2](f: L => L2)(implicit trace: Trace): ZSink[R, E, In, L2, Z]

Transforms the leftovers emitted by this sink using f.

Transforms the leftovers emitted by this sink using f.

Attributes

Source
ZSink.scala
def mapZIO[R1 <: R, E1 >: E, Z1](f: Z => ZIO[R1, E1, Z1])(implicit trace: Trace): ZSink[R1, E1, In, L, Z1]

Effectfully transforms this sink's result.

Effectfully transforms this sink's result.

Attributes

Source
ZSink.scala
def orElse[R1 <: R, In1 <: In, E2, L1 >: L, Z1 >: Z](that: => ZSink[R1, E2, In1, L1, Z1])(implicit trace: Trace): ZSink[R1, E2, In1, L1, Z1]

Switch to another sink in case of failure

Switch to another sink in case of failure

Attributes

Source
ZSink.scala
def provideEnvironment(r: => ZEnvironment[R])(implicit trace: Trace): ZSink[Any, E, In, L, Z]

Provides the sink with its required environment, which eliminates its dependency on R.

Provides the sink with its required environment, which eliminates its dependency on R.

Attributes

Source
ZSink.scala
def provideLayer[E1 >: E, R0](layer: => ZLayer[R0, E1, R])(implicit trace: Trace): ZSink[R0, E1, In, L, Z]

Provides a layer to the sink, which translates it to another level.

Provides a layer to the sink, which translates it to another level.

Attributes

Source
ZSink.scala
def provideSomeEnvironment[R0](f: (ZEnvironment[R0]) => ZEnvironment[R])(implicit trace: Trace): ZSink[R0, E, In, L, Z]

Transforms the environment being provided to the sink with the specified function.

Transforms the environment being provided to the sink with the specified function.

Attributes

Source
ZSink.scala
def provideSomeLayer[R0]: ProvideSomeLayer[R0, R, E, In, L, Z]

Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

val loggingLayer: ZLayer[Any, Nothing, Logging] = ???

val sink: ZSink[Logging with Database, Nothing, Unit] = ???

val sink2 = sink.provideSomeLayer[Database](loggingLayer)

Attributes

Source
ZSink.scala
def race[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L, Z1 >: Z](that: => ZSink[R1, E1, In1, L1, Z1])(implicit trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Runs both sinks in parallel on the input, , returning the result or the error from the one that finishes first.

Runs both sinks in parallel on the input, , returning the result or the error from the one that finishes first.

Attributes

Source
ZSink.scala
def raceBoth[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L, Z2](that: => ZSink[R1, E1, In1, L1, Z2], capacity: => Int = ...)(implicit trace: Trace): ZSink[R1, E1, In1, L1, Either[Z, Z2]]

Runs both sinks in parallel on the input, returning the result or the error from the one that finishes first.

Runs both sinks in parallel on the input, returning the result or the error from the one that finishes first.

Attributes

Source
ZSink.scala
def raceWith[R1 <: R, E1 >: E, A0, In1 <: In, L1 >: L, Z1, Z2](that: => ZSink[R1, E1, In1, L1, Z1], capacity: => Int = ...)(leftDone: (Exit[E, Z]) => MergeDecision[R1, E1, Z1, E1, Z2], rightDone: (Exit[E1, Z1]) => MergeDecision[R1, E, Z, E1, Z2])(implicit trace: Trace): ZSink[R1, E1, In1, L1, Z2]

Runs both sinks in parallel on the input, using the specified merge function as soon as one result or the other has been computed.

Runs both sinks in parallel on the input, using the specified merge function as soon as one result or the other has been computed.

Attributes

Source
ZSink.scala
def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: IsSubtypeOfError[E, Throwable], ev2: CanFail[E], trace: Trace): ZSink[R, E1, In, L, Z]

Attributes

Source
ZSink.scala
def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: E => Throwable)(implicit ev: CanFail[E], trace: Trace): ZSink[R, E1, In, L, Z]

Attributes

Source
ZSink.scala
def splitWhere[In1 <: In](f: In1 => Boolean)(implicit ev: L <:< In1, trace: Trace): ZSink[R, E, In1, In1, Z]

Splits the sink on the specified predicate, returning a new sink that consumes elements until an element after the first satisfies the specified predicate.

Splits the sink on the specified predicate, returning a new sink that consumes elements until an element after the first satisfies the specified predicate.

Attributes

Source
ZSink.scala
def summarized[R1 <: R, E1 >: E, B, C](summary: => ZIO[R1, E1, B])(f: (B, B) => C)(implicit trace: Trace): ZSink[R1, E1, In, L, (Z, C)]

Summarize a sink by running an effect when the sink starts and again when it completes

Summarize a sink by running an effect when the sink starts and again when it completes

Attributes

Source
ZSink.scala
def timed(implicit trace: Trace): ZSink[R, E, In, L, (Z, Duration)]

Returns the sink that executes this one and times its execution.

Returns the sink that executes this one and times its execution.

Attributes

Source
ZSink.scala
def toChannel: ZChannel[R, ZNothing, Chunk[In], Any, E, Chunk[L], Z]

Converts ths sink to its underlying channel

Converts ths sink to its underlying channel

Attributes

Source
ZSink.scala
def zip[R1 <: R, In1 <: In, E1 >: E, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit zippable: Zippable[Z, Z1], ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, zippable.Out]

Feeds inputs to this sink until it yields a result, then switches over to the provided sink until it yields a result, finally combining the two results into a tuple.

Feeds inputs to this sink until it yields a result, then switches over to the provided sink until it yields a result, finally combining the two results into a tuple.

Attributes

Source
ZSink.scala
def zipLeft[R1 <: R, In1 <: In, E1 >: E, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z]

Like zip, but keeps only the result from the that sink.

Like zip, but keeps only the result from the that sink.

Attributes

Source
ZSink.scala
def zipPar[R1 <: R, In1 <: In, E1 >: E, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit zippable: Zippable[Z, Z1], trace: Trace): ZSink[R1, E1, In1, L1, zippable.Out]

Runs both sinks in parallel on the input and combines the results in a tuple.

Runs both sinks in parallel on the input and combines the results in a tuple.

Attributes

Source
ZSink.scala
def zipParLeft[R1 <: R, In1 <: In, E1 >: E, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit trace: Trace): ZSink[R1, E1, In1, L1, Z]

Like zipPar, but keeps only the result from this sink.

Like zipPar, but keeps only the result from this sink.

Attributes

Source
ZSink.scala
def zipParRight[R1 <: R, In1 <: In, E1 >: E, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Like zipPar, but keeps only the result from the that sink.

Like zipPar, but keeps only the result from the that sink.

Attributes

Source
ZSink.scala
def zipRight[R1 <: R, In1 <: In, E1 >: E, L1 >: L <: In1, Z1](that: => ZSink[R1, E1, In1, L1, Z1])(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Like zip, but keeps only the result from this sink.

Like zip, but keeps only the result from this sink.

Attributes

Source
ZSink.scala
def zipWith[R1 <: R, E1 >: E, In1 <: In, L1 >: L <: In1, Z1, Z2](that: => ZSink[R1, E1, In1, L1, Z1])(f: (Z, Z1) => Z2)(implicit ev: L <:< In1, trace: Trace): ZSink[R1, E1, In1, L1, Z2]

Feeds inputs to this sink until it yields a result, then switches over to the provided sink until it yields a result, finally combining the two results with f.

Feeds inputs to this sink until it yields a result, then switches over to the provided sink until it yields a result, finally combining the two results with f.

Attributes

Source
ZSink.scala
def zipWithPar[R1 <: R, E1 >: E, In1 <: In, L1 >: L <: In1, Z1, Z2](that: => ZSink[R1, E1, In1, L1, Z1])(f: (Z, Z1) => Z2)(implicit trace: Trace): ZSink[R1, E1, In1, L1, Z2]

Runs both sinks in parallel on the input and combines the results using the provided function.

Runs both sinks in parallel on the input and combines the results using the provided function.

Attributes

Source
ZSink.scala
def |[R1 <: R, E1 >: E, In1 <: In, L1 >: L, Z1 >: Z](that: => ZSink[R1, E1, In1, L1, Z1])(implicit trace: Trace): ZSink[R1, E1, In1, L1, Z1]

Operator alias for race.

Operator alias for race.

Attributes

Source
ZSink.scala

Concrete fields

val channel: ZChannel[R, ZNothing, Chunk[In], Any, E, Chunk[L], Z]

Attributes

Source
ZSink.scala