ZSink

zio.stream.ZSink
See theZSink companion class
object ZSink

Attributes

Companion
class
Source
ZSink.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ZSink.type

Members list

Type members

Classlikes

final class EnvironmentWithPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class EnvironmentWithSinkPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class EnvironmentWithZIOPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class ProvideSomeLayer[R0, -R, +E, -In, +L, +Z](channel: ZChannel[R, ZNothing, Chunk[In], Any, E, Chunk[L], Z]) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class ServiceAtPartiallyApplied[Service](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class ServiceWithPartiallyApplied[Service](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class ServiceWithSinkPartiallyApplied[Service](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class ServiceWithZIOPartiallyApplied[Service](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any
final class UnwrapScopedPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZSink.scala
Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def collectAll[In](implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, Chunk[In]]

Attributes

Source
ZSink.scala
def collectAllN[In](n: => Int)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Chunk[In]]

A sink that collects first n elements into a chunk.

A sink that collects first n elements into a chunk.

Attributes

Source
ZSink.scala
def collectAllToMap[In, K](key: In => K)(f: (In, In) => In)(implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, Map[K, In]]

A sink that collects all of its inputs into a map. The keys are extracted from inputs using the keying function key; if multiple inputs use the same key, they are merged using the f function.

A sink that collects all of its inputs into a map. The keys are extracted from inputs using the keying function key; if multiple inputs use the same key, they are merged using the f function.

Attributes

Source
ZSink.scala
def collectAllToMapN[Err, In, K](n: => Long)(key: In => K)(f: (In, In) => In)(implicit trace: Trace): ZSink[Any, Err, In, In, Map[K, In]]

A sink that collects first n keys into a map. The keys are calculated from inputs using the keying function key; if multiple inputs use the the same key, they are merged using the f function.

A sink that collects first n keys into a map. The keys are calculated from inputs using the keying function key; if multiple inputs use the the same key, they are merged using the f function.

Attributes

Source
ZSink.scala
def collectAllToMapValue[In, K, V](key: In => K)(value: In => V)(f: (V, V) => V)(implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, Map[K, V]]

A sink that collects all of its inputs into a map. The keys are extracted from inputs using the keying function key; The values are extracted using the value function value if multiple inputs use the same key, they are merged using the f function.

A sink that collects all of its inputs into a map. The keys are extracted from inputs using the keying function key; The values are extracted using the value function value if multiple inputs use the same key, they are merged using the f function.

Attributes

Source
ZSink.scala
def collectAllToMapValueN[Err, In, K, V](n: => Long)(key: In => K)(value: In => V)(f: (V, V) => V)(implicit trace: Trace): ZSink[Any, Err, In, In, Map[K, V]]

A sink that collects first n keys into a map. The keys are calculated from inputs using the keying function key; The values are extracted using

A sink that collects first n keys into a map. The keys are calculated from inputs using the keying function key; The values are extracted using

  • the value function value if multiple inputs use the the same key, they are merged using the f function.

Attributes

Source
ZSink.scala
def collectAllToSet[In](implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, Set[In]]

A sink that collects all of its inputs into a set.

A sink that collects all of its inputs into a set.

Attributes

Source
ZSink.scala
def collectAllToSetN[In](n: => Long)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Set[In]]

A sink that collects first n distinct inputs into a set.

A sink that collects first n distinct inputs into a set.

Attributes

Source
ZSink.scala
def collectAllUntil[In](p: In => Boolean)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Chunk[In]]

Accumulates incoming elements into a chunk until predicate p is satisfied.

Accumulates incoming elements into a chunk until predicate p is satisfied.

Attributes

Source
ZSink.scala
def collectAllUntilZIO[Env, Err, In](p: In => ZIO[Env, Err, Boolean])(implicit trace: Trace): ZSink[Env, Err, In, In, Chunk[In]]

Accumulates incoming elements into a chunk until effectful predicate p is satisfied.

Accumulates incoming elements into a chunk until effectful predicate p is satisfied.

Attributes

Source
ZSink.scala
def collectAllWhile[In](p: In => Boolean)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Chunk[In]]

Accumulates incoming elements into a chunk as long as they verify predicate p.

Accumulates incoming elements into a chunk as long as they verify predicate p.

Attributes

Source
ZSink.scala
def collectAllWhileZIO[Env, Err, In](p: In => ZIO[Env, Err, Boolean])(implicit trace: Trace): ZSink[Env, Err, In, In, Chunk[In]]

Accumulates incoming elements into a chunk as long as they verify effectful predicate p.

Accumulates incoming elements into a chunk as long as they verify effectful predicate p.

Attributes

Source
ZSink.scala
def count(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Long]

A sink that counts the number of elements fed to it.

A sink that counts the number of elements fed to it.

Attributes

Source
ZSink.scala
def die(e: => Throwable)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Nothing]

Creates a sink halting with the specified Throwable.

Creates a sink halting with the specified Throwable.

Attributes

Source
ZSink.scala
def dieMessage(m: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Nothing]

Creates a sink halting with the specified message, wrapped in a RuntimeException.

Creates a sink halting with the specified message, wrapped in a RuntimeException.

Attributes

Source
ZSink.scala
def drain(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

A sink that ignores its inputs.

A sink that ignores its inputs.

Attributes

Source
ZSink.scala
def dropUntil[In](p: In => Boolean)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Any]

Drops incoming elements until the predicate p is satisfied.

Drops incoming elements until the predicate p is satisfied.

Attributes

Source
ZSink.scala
def dropUntilZIO[R, InErr, In](p: In => ZIO[R, InErr, Boolean])(implicit trace: Trace): ZSink[R, InErr, In, In, Any]

Drops incoming elements until the effectful predicate p is satisfied.

Drops incoming elements until the effectful predicate p is satisfied.

Attributes

Source
ZSink.scala
def dropWhile[In](p: In => Boolean)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Any]

Drops incoming elements as long as the predicate p is satisfied.

Drops incoming elements as long as the predicate p is satisfied.

Attributes

Source
ZSink.scala
def dropWhileZIO[R, InErr, In](p: In => ZIO[R, InErr, Boolean])(implicit trace: Trace): ZSink[R, InErr, In, In, Any]

Drops incoming elements as long as the effectful predicate p is satisfied.

Drops incoming elements as long as the effectful predicate p is satisfied.

Attributes

Source
ZSink.scala
def environment[R](implicit trace: Trace): ZSink[R, Nothing, Any, Nothing, ZEnvironment[R]]

Accesses the whole environment of the sink.

Accesses the whole environment of the sink.

Attributes

Source
ZSink.scala

Accesses the environment of the sink.

Accesses the environment of the sink.

Attributes

Source
ZSink.scala

Accesses the environment of the sink in the context of a sink.

Accesses the environment of the sink in the context of a sink.

Attributes

Source
ZSink.scala

Accesses the environment of the sink in the context of an effect.

Accesses the environment of the sink in the context of an effect.

Attributes

Source
ZSink.scala
def exists[In](f: In => Boolean)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Boolean]

A sink that returns whether an element satisfies the specified predicate.

A sink that returns whether an element satisfies the specified predicate.

Attributes

Source
ZSink.scala
def fail[E](e: => E)(implicit trace: Trace): ZSink[Any, E, Any, Nothing, Nothing]

A sink that always fails with the specified error.

A sink that always fails with the specified error.

Attributes

Source
ZSink.scala
def failCause[E](e: => Cause[E])(implicit trace: Trace): ZSink[Any, E, Any, Nothing, Nothing]

Creates a sink halting with a specified cause.

Creates a sink halting with a specified cause.

Attributes

Source
ZSink.scala
def fold[In, S](z: => S)(contFn: S => Boolean)(f: (S, In) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, In, S]

A sink that folds its inputs with the provided function, termination predicate and initial state.

A sink that folds its inputs with the provided function, termination predicate and initial state.

Attributes

Source
ZSink.scala
def foldChunks[In, S](z: => S)(contFn: S => Boolean)(f: (S, Chunk[In]) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, S]

A sink that folds its input chunks with the provided function, termination predicate and initial state. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

A sink that folds its input chunks with the provided function, termination predicate and initial state. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

Attributes

Source
ZSink.scala
def foldChunksZIO[Env, Err, In, S](z: => S)(contFn: S => Boolean)(f: (S, Chunk[In]) => ZIO[Env, Err, S])(implicit trace: Trace): ZSink[Env, Err, In, In, S]

A sink that effectfully folds its input chunks with the provided function, termination predicate and initial state. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

A sink that effectfully folds its input chunks with the provided function, termination predicate and initial state. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

Attributes

Source
ZSink.scala
def foldLeft[In, S](z: => S)(f: (S, In) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, S]

A sink that folds its inputs with the provided function and initial state.

A sink that folds its inputs with the provided function and initial state.

Attributes

Source
ZSink.scala
def foldLeftChunks[In, S](z: => S)(f: (S, Chunk[In]) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, S]

A sink that folds its input chunks with the provided function and initial state. f must preserve chunking-invariance.

A sink that folds its input chunks with the provided function and initial state. f must preserve chunking-invariance.

Attributes

Source
ZSink.scala
def foldLeftChunksZIO[R, Err, In, S](z: => S)(f: (S, Chunk[In]) => ZIO[R, Err, S])(implicit trace: Trace): ZSink[R, Err, In, Nothing, S]

A sink that effectfully folds its input chunks with the provided function and initial state. f must preserve chunking-invariance.

A sink that effectfully folds its input chunks with the provided function and initial state. f must preserve chunking-invariance.

Attributes

Source
ZSink.scala
def foldLeftZIO[R, Err, In, S](z: => S)(f: (S, In) => ZIO[R, Err, S])(implicit trace: Trace): ZSink[R, Err, In, Nothing, S]

A sink that effectfully folds its inputs with the provided function and initial state.

A sink that effectfully folds its inputs with the provided function and initial state.

Attributes

Source
ZSink.scala
def foldUntil[In, S](z: => S, max: => Long)(f: (S, In) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, In, S]

Creates a sink that folds elements of type In into a structure of type S until max elements have been folded.

Creates a sink that folds elements of type In into a structure of type S until max elements have been folded.

Like foldWeighted, but with a constant cost function of 1.

Attributes

Source
ZSink.scala
def foldUntilZIO[Env, Err, In, S](z: => S, max: => Long)(f: (S, In) => ZIO[Env, Err, S])(implicit trace: Trace): ZSink[Env, Err, In, In, S]

Creates a sink that effectfully folds elements of type In into a structure of type S until max elements have been folded.

Creates a sink that effectfully folds elements of type In into a structure of type S until max elements have been folded.

Like foldWeightedZIO, but with a constant cost function of 1.

Attributes

Source
ZSink.scala
def foldWeighted[In, S](z: => S)(costFn: (S, In) => Long, max: => Long)(f: (S, In) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, In, S]

Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

Attributes

Note

Elements that have an individual cost larger than max will force the sink to cross the max cost. See foldWeightedDecompose for a variant that can handle these cases.

Source
ZSink.scala
def foldWeightedDecompose[In, S](z: => S)(costFn: (S, In) => Long, max: => Long, decompose: In => Chunk[In])(f: (S, In) => S)(implicit trace: Trace): ZSink[Any, Nothing, In, In, S]

Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

The decompose function will be used for decomposing elements that cause an S aggregate to cross max into smaller elements. For example:

Stream(1, 5, 1)
 .transduce(
   ZSink
     .foldWeightedDecompose(List[Int]())((i: Int) => i.toLong, 4,
       (i: Int) => Chunk(i - 1, 1)) { (acc, el) =>
       el :: acc
     }
     .map(_.reverse)
 )
 .runCollect

The stream would emit the elements List(1), List(4), List(1, 1).

Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

The foldWeightedDecomposeZIO allows the decompose function to return a ZIO value, and consequently it allows the sink to fail.

Attributes

Source
ZSink.scala
def foldWeightedDecomposeZIO[Env, Err, In, S](z: => S)(costFn: (S, In) => ZIO[Env, Err, Long], max: => Long, decompose: In => ZIO[Env, Err, Chunk[In]])(f: (S, In) => ZIO[Env, Err, S])(implicit trace: Trace): ZSink[Env, Err, In, In, S]

Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

The decompose function will be used for decomposing elements that cause an S aggregate to cross max into smaller elements. Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

See foldWeightedDecompose for an example.

Attributes

Source
ZSink.scala
def foldWeightedZIO[Env, Err, In, S](z: => S)(costFn: (S, In) => ZIO[Env, Err, Long], max: Long)(f: (S, In) => ZIO[Env, Err, S])(implicit trace: Trace): ZSink[Env, Err, In, In, S]

Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

Attributes

Note

Elements that have an individual cost larger than max will force the sink to cross the max cost. See foldWeightedDecomposeZIO for a variant that can handle these cases.

Source
ZSink.scala
def foldZIO[Env, Err, In, S](z: => S)(contFn: S => Boolean)(f: (S, In) => ZIO[Env, Err, S])(implicit trace: Trace): ZSink[Env, Err, In, In, S]

A sink that effectfully folds its inputs with the provided function, termination predicate and initial state.

A sink that effectfully folds its inputs with the provided function, termination predicate and initial state.

Attributes

Source
ZSink.scala
def forall[In](f: In => Boolean)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Boolean]

A sink that returns whether all elements satisfy the specified predicate.

A sink that returns whether all elements satisfy the specified predicate.

Attributes

Source
ZSink.scala
def foreach[R, Err, In](f: In => ZIO[R, Err, Any])(implicit trace: Trace): ZSink[R, Err, In, Nothing, Unit]

A sink that executes the provided effectful function for every element fed to it.

A sink that executes the provided effectful function for every element fed to it.

Attributes

Source
ZSink.scala
def foreachChunk[R, Err, In](f: (Chunk[In]) => ZIO[R, Err, Any])(implicit trace: Trace): ZSink[R, Err, In, Nothing, Unit]

A sink that executes the provided effectful function for every chunk fed to it.

A sink that executes the provided effectful function for every chunk fed to it.

Attributes

Source
ZSink.scala
def foreachChunkWhile[R, Err, In](f: (Chunk[In]) => ZIO[R, Err, Boolean])(implicit trace: Trace): ZSink[R, Err, In, In, Unit]

A sink that executes the provided effectful function for every chunk fed to it until f evaluates to false.

A sink that executes the provided effectful function for every chunk fed to it until f evaluates to false.

Attributes

Source
ZSink.scala
def foreachWhile[R, Err, In](f: In => ZIO[R, Err, Boolean])(implicit trace: Trace): ZSink[R, Err, In, In, Unit]

A sink that executes the provided effectful function for every element fed to it until f evaluates to false.

A sink that executes the provided effectful function for every element fed to it until f evaluates to false.

Attributes

Source
ZSink.scala
def fromChannel[R, E, In, L, Z](channel: ZChannel[R, ZNothing, Chunk[In], Any, E, Chunk[L], Z]): ZSink[R, E, In, L, Z]

Creates a sink from a zio.stream.ZChannel

Creates a sink from a zio.stream.ZChannel

Attributes

Source
ZSink.scala
def fromHub[I](hub: => Hub[I])(implicit trace: Trace): ZSink[Any, Nothing, I, Nothing, Unit]

Create a sink which publishes each element to the specified hub.

Create a sink which publishes each element to the specified hub.

Attributes

Source
ZSink.scala
def fromHubWithShutdown[I](hub: => Hub[I])(implicit trace: Trace): ZSink[Any, Nothing, I, Nothing, Unit]

Create a sink which publishes each element to the specified hub. The hub will be shutdown once the stream is closed.

Create a sink which publishes each element to the specified hub. The hub will be shutdown once the stream is closed.

Attributes

Source
ZSink.scala
def fromPush[R, E, I, L, Z](push: ZIO[Scope & R, Nothing, (Option[Chunk[I]]) => ZIO[R, (Either[E, Z], Chunk[L]), Unit]])(implicit trace: Trace): ZSink[R, E, I, L, Z]

Creates a sink from a chunk processing function.

Creates a sink from a chunk processing function.

Attributes

Source
ZSink.scala
def fromQueue[I](queue: => Enqueue[I])(implicit trace: Trace): ZSink[Any, Nothing, I, Nothing, Unit]

Create a sink which enqueues each element into the specified queue.

Create a sink which enqueues each element into the specified queue.

Attributes

Source
ZSink.scala
def fromQueueWithShutdown[I](queue: => Enqueue[I])(implicit trace: Trace): ZSink[Any, Nothing, I, Nothing, Unit]

Create a sink which enqueues each element into the specified queue. The queue will be shutdown once the stream is closed.

Create a sink which enqueues each element into the specified queue. The queue will be shutdown once the stream is closed.

Attributes

Source
ZSink.scala
def fromZIO[R, E, Z](b: => ZIO[R, E, Z])(implicit trace: Trace): ZSink[R, E, Any, Nothing, Z]

Creates a single-value sink produced from an effect

Creates a single-value sink produced from an effect

Attributes

Source
ZSink.scala
def head[In](implicit trace: Trace): ZSink[Any, Nothing, In, In, Option[In]]

Creates a sink containing the first value.

Creates a sink containing the first value.

Attributes

Source
ZSink.scala
def last[In](implicit trace: Trace): ZSink[Any, Nothing, In, Nothing, Option[In]]

Creates a sink containing the last value.

Creates a sink containing the last value.

Attributes

Source
ZSink.scala
def leftover[L](c: => Chunk[L])(implicit trace: Trace): ZSink[Any, Nothing, Any, L, Unit]

Creates a sink that does not consume any input but provides the given chunk as its leftovers

Creates a sink that does not consume any input but provides the given chunk as its leftovers

Attributes

Source
ZSink.scala
def log(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the current log level.

Logs the specified message at the current log level.

Attributes

Source
ZSink.scala
def logAnnotate[R, E, In, L, Z](key: => String, value: => String)(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Annotates each log in streams composed after this with the specified log annotation.

Annotates each log in streams composed after this with the specified log annotation.

Attributes

Source
ZSink.scala
def logAnnotate[R, E, In, L, Z](annotation: => LogAnnotation, annotations: LogAnnotation*)(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Annotates each log in streams composed after this with the specified log annotation.

Annotates each log in streams composed after this with the specified log annotation.

Attributes

Source
ZSink.scala
def logAnnotate[R, E, In, L, Z](annotations: => Set[LogAnnotation])(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Annotates each log in streams composed after this with the specified log annotation.

Annotates each log in streams composed after this with the specified log annotation.

Attributes

Source
ZSink.scala
def logAnnotations(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Map[String, String]]

Retrieves the log annotations associated with the current scope.

Retrieves the log annotations associated with the current scope.

Attributes

Source
ZSink.scala
def logDebug(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the debug log level.

Logs the specified message at the debug log level.

Attributes

Source
ZSink.scala
def logError(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the error log level.

Logs the specified message at the error log level.

Attributes

Source
ZSink.scala
def logErrorCause(cause: => Cause[Any])(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified cause as an error.

Logs the specified cause as an error.

Attributes

Source
ZSink.scala
def logFatal(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the fatal log level.

Logs the specified message at the fatal log level.

Attributes

Source
ZSink.scala
def logInfo(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the informational log level.

Logs the specified message at the informational log level.

Attributes

Source
ZSink.scala
def logLevel[R, E, In, L, Z](level: LogLevel)(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Sets the log level for streams composed after this.

Sets the log level for streams composed after this.

Attributes

Source
ZSink.scala
def logSpan[R, E, In, L, Z](label: => String)(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Adjusts the label for the logging span for streams composed after this.

Adjusts the label for the logging span for streams composed after this.

Attributes

Source
ZSink.scala
def logTrace(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the trace log level.

Logs the specified message at the trace log level.

Attributes

Source
ZSink.scala
def logWarning(message: => String)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Unit]

Logs the specified message at the warning log level.

Logs the specified message at the warning log level.

Attributes

Source
ZSink.scala
def mkString(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, String]

Attributes

Source
ZSink.scala
def never(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Nothing]

Attributes

Source
ZSink.scala
def service[Z : Tag](implicit evidence$1: Tag[Z], trace: Trace): ZSink[Z, Nothing, Any, Nothing, Z]

Accesses the specified service in the environment of the effect.

Accesses the specified service in the environment of the effect.

Attributes

Source
ZSink.scala
def serviceAt[Service]: ServiceAtPartiallyApplied[Service]

Accesses the service corresponding to the specified key in the environment.

Accesses the service corresponding to the specified key in the environment.

Attributes

Source
ZSink.scala
def serviceWith[Service]: ServiceWithPartiallyApplied[Service]

Accesses the specified service in the environment of the sink.

Accesses the specified service in the environment of the sink.

Attributes

Source
ZSink.scala

Accesses the specified service in the environment of the sink in the context of a sink.

Accesses the specified service in the environment of the sink in the context of a sink.

Attributes

Source
ZSink.scala

Accesses the specified service in the environment of the sink in the context of an effect.

Accesses the specified service in the environment of the sink in the context of an effect.

Attributes

Source
ZSink.scala
def succeed[Z](z: => Z)(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Z]

A sink that immediately ends with the specified value.

A sink that immediately ends with the specified value.

Attributes

Source
ZSink.scala
def sum[A](implicit A: Numeric[A], trace: Trace): ZSink[Any, Nothing, A, Nothing, A]

A sink that sums incoming numeric values.

A sink that sums incoming numeric values.

Attributes

Source
ZSink.scala
def suspend[Env, E, In, Leftover, Done](sink: => ZSink[Env, E, In, Leftover, Done])(implicit trace: Trace): ZSink[Env, E, In, Leftover, Done]

Returns a lazily constructed sink that may require effects for its creation.

Returns a lazily constructed sink that may require effects for its creation.

Attributes

Source
ZSink.scala
def tagged[R, E, In, L, Z](key: => String, value: => String)(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Tags each metric in this sink with the specific tag.

Tags each metric in this sink with the specific tag.

Attributes

Source
ZSink.scala
def tagged[R, E, In, L, Z](tag: => MetricLabel, tags: MetricLabel*)(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Tags each metric in this sink with the specific tag.

Tags each metric in this sink with the specific tag.

Attributes

Source
ZSink.scala
def tagged[R, E, In, L, Z](tags: => Set[MetricLabel])(sink: ZSink[R, E, In, L, Z])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Tags each metric in this sink with the specific tag.

Tags each metric in this sink with the specific tag.

Attributes

Source
ZSink.scala
def tags(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Set[MetricLabel]]

Retrieves the metric tags associated with the current scope.

Retrieves the metric tags associated with the current scope.

Attributes

Source
ZSink.scala
def take[In](n: Int)(implicit trace: Trace): ZSink[Any, Nothing, In, In, Chunk[In]]

A sink that takes the specified number of values.

A sink that takes the specified number of values.

Attributes

Source
ZSink.scala
def timed(implicit trace: Trace): ZSink[Any, Nothing, Any, Nothing, Duration]

Attributes

Source
ZSink.scala
def unwrap[R, E, In, L, Z](zio: => ZIO[R, E, ZSink[R, E, In, L, Z]])(implicit trace: Trace): ZSink[R, E, In, L, Z]

Creates a sink produced from an effect.

Creates a sink produced from an effect.

Attributes

Source
ZSink.scala

Creates a sink produced from a scoped effect.

Creates a sink produced from a scoped effect.

Attributes

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

Creates a sink produced from a scoped effect.

Creates a sink produced from a scoped effect.

Attributes

Source
ZSink.scala

Inherited methods

def digest(digest: => MessageDigest): ZSink[Any, Nothing, Byte, Nothing, Chunk[Byte]]

Creates a sink which digests incoming bytes using Java's MessageDigest class, returning the digest value.

Creates a sink which digests incoming bytes using Java's MessageDigest class, returning the digest value.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala
final def fromFile(file: => File, position: => Long = ..., options: => Set[OpenOption] = ...)(implicit trace: Trace): ZSink[Any, Throwable, Byte, Byte, Long]

Uses the provided File to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Uses the provided File to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala
final def fromFileName(name: => String, position: => Long = ..., options: => Set[OpenOption] = ...)(implicit trace: Trace): ZSink[Any, Throwable, Byte, Byte, Long]

Uses the provided Path represented as a string to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Uses the provided Path represented as a string to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala
final def fromFileURI(uri: => URI, position: => Long = ..., options: => Set[OpenOption] = ...)(implicit trace: Trace): ZSink[Any, Throwable, Byte, Byte, Long]

Uses the provided URI to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Uses the provided URI to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala
final def fromOutputStream(os: => OutputStream)(implicit trace: Trace): ZSink[Any, IOException, Byte, Byte, Long]

Uses the provided OutputStream to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

Uses the provided OutputStream to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

The caller of this function is responsible for closing the OutputStream.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala
final def fromOutputStreamScoped(os: => ZIO[Scope, IOException, OutputStream])(implicit trace: Trace): ZSink[Any, IOException, Byte, Byte, Long]

Uses the provided OutputStream resource to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

Uses the provided OutputStream resource to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

The Scope of the provided effect will be automatically closed after the stream is finished or an error occurred. It's the responsibility of the user to attach the closing of the OutputStream to the Scope.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala
final def fromPath(path: => Path, position: => Long = ..., options: => Set[OpenOption] = ...)(implicit trace: Trace): ZSink[Any, Throwable, Byte, Byte, Long]

Uses the provided Path to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Uses the provided Path to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Attributes

Inherited from:
ZSinkPlatformSpecificConstructors (hidden)
Source
platform.scala