Dispose

better.files.Dispose
See theDispose companion object
class Dispose[A](val resource: A)(implicit disposer: Disposable[A])

Given a disposable resource, this actually does the disposing

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def apply[B](f: A => B): B

Apply f to the resource and return it after closing the resource If you don't wish to close the resource (e.g. if you are creating an iterator on file contents), use flatMap instead

Apply f to the resource and return it after closing the resource If you don't wish to close the resource (e.g. if you are creating an iterator on file contents), use flatMap instead

Attributes

def flatMap[B, F[_]](f: A => F[B])(implicit fv: FlatMap[F]): Output[B]

This keeps the resource open during the context of this flatMap and closes when done

This keeps the resource open during the context of this flatMap and closes when done

Attributes

def foreach[U](f: A => U): Unit

This will immediately apply f on the resource and close the resource

This will immediately apply f on the resource and close the resource

Attributes

def get(): A

Dispose this resource and return it Note: If you are using map followed by get, consider using apply instead

Dispose this resource and return it Note: If you are using map followed by get, consider using apply instead

Attributes

def map[B](f: A => B): Dispose[B]

This will apply f on the resource while it is open

This will apply f on the resource while it is open

Attributes

def withFilter(f: A => Boolean): Dispose.this.type