ResourceIO

object ResourceIO extends ResourceIOOps with IOOps[Resource]

Object containing the operations that act on a Resource.

trait IOOps[Resource]
trait IOBaseOps[Resource]
class Object
trait Matchable
class Any

Value members

Inherited methods

def access[A](f: Resource => A): RIO[Resource, A]

Returns a operation that requires this resource.

Returns a operation that requires this resource.

Inherited from:
IOOps
def accessResource[A](f: Resource => A): ResourceIO[A]

Store an unsafe resource operation in a ResourceIO.

Store an unsafe resource operation in a ResourceIO.

Inherited from:
ResourceIOOps
def foreach[A](it: () => Iterator[A])(f: A => RIO[Resource, Any]): RIO[Resource, Unit]

Applies an operation to each element of a Iterator[A] and discards the result.

Applies an operation to each element of a Iterator[A] and discards the result.

Inherited from:
IOOps
def foreach[A](it: Iterable[A])(f: A => RIO[Resource, Any]): RIO[Resource, Unit]

Applies an operation to each element of a Iterable[A] and discards the result.

Applies an operation to each element of a Iterable[A] and discards the result.

Inherited from:
IOOps
def fromCallback[A](operation: (Try[A] => Unit) => Unit): RIO[Resource, Poll[A]]

Returns a Poll from a function that receives a callback

Returns a Poll from a function that receives a callback

Inherited from:
IOBaseOps
def pure[A](x: A): RIO[Resource, A]

Lifts a value into a RIO.

Lifts a value into a RIO.

Inherited from:
IOBaseOps
def sequence[A](it: Iterable[RIO[Resource, A]]): RIO[Resource, List[A]]

Converts an Iterable[RIO[R, A]] into a RIO[R, List[A]].

Converts an Iterable[RIO[R, A]] into a RIO[R, List[A]].

Inherited from:
IOOps
def sequence_(it: Iterable[RIO[Resource, Any]]): RIO[Resource, Unit]

Converts an Iterable[RIO[R, A]] into a RIO[R, Unit].

Converts an Iterable[RIO[R, A]] into a RIO[R, Unit].

Inherited from:
IOOps
def suspend[A](x: => A): RIO[Resource, A]

Suspends a computation into a RIO.

Suspends a computation into a RIO.

Inherited from:
IOBaseOps
def traverse[A, B](it: Iterable[A])(f: A => RIO[Resource, B]): RIO[Resource, List[B]]

Converts an Iterable[A] into a RIO[R, List[B]] by applying an operation to each element.

Converts an Iterable[A] into a RIO[R, List[B]] by applying an operation to each element.

Inherited from:
IOOps
def when(predicate: Boolean)(io: => RIO[Resource, Unit]): RIO[Resource, Unit]

Runs a computation only if the predicate is true, otherwise does nothing

Runs a computation only if the predicate is true, otherwise does nothing

Inherited from:
IOOps
def withInputStream[A](f: InputStream => A): ResourceIO[Try[A]]

Loads the resource synchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Loads the resource synchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Inherited from:
ResourceIOOps
def withInputStreamAsync[A](f: InputStream => A): ResourceIO[Poll[A]]

Loads the resource asynchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Loads the resource asynchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Inherited from:
ResourceIOOps
def withOutputStream[A](f: OutputStream => A): ResourceIO[Try[A]]

Provides a java.io.OutputStream to write data to this resource location. The OutputStream is closed in the end, so it should not escape this call.

Provides a java.io.OutputStream to write data to this resource location. The OutputStream is closed in the end, so it should not escape this call.

Inherited from:
ResourceIOOps
def withSource[A](f: Source => A): ResourceIO[Try[A]]

Loads the resource synchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStream instead.

Loads the resource synchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStream instead.

Inherited from:
ResourceIOOps
def withSourceAsync[A](f: Source => A): ResourceIO[Poll[A]]

Loads the resource asynchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStreamAsync instead.

Loads the resource asynchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStreamAsync instead.

Inherited from:
ResourceIOOps

Inherited fields

Checks if the resource exists

Checks if the resource exists

Inherited from:
ResourceIOOps
val noop: RIO[Resource, Unit]

An operation that does nothing.

An operation that does nothing.

Inherited from:
IOBaseOps

Path to the resource

Path to the resource

Inherited from:
ResourceIOOps