All Downloads are FREE. Search and download functionalities are using the official Maven repository.

caliban.interop.tapir.StreamConstructor.scala Maven / Gradle / Ivy

The newest version!
package caliban.interop.tapir

import zio.stream.ZStream

trait StreamConstructor[BS] {
  def apply(stream: ZStream[Any, Throwable, Byte]): BS
}

object StreamConstructor {
  implicit val zioStreams: StreamConstructor[ZStream[Any, Throwable, Byte]] =
    (stream: ZStream[Any, Throwable, Byte]) => stream

  implicit val noStreams: StreamConstructor[Nothing] =
    (_: ZStream[Any, Throwable, Byte]) => throw new UnsupportedOperationException("Streams are not supported")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy