grizzled

util

package util

Miscellaneous utility functions and methods not otherwise categorized.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. util
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait CanReleaseResource[-T] extends AnyRef

    withResource() needs an implicit evidence parameter of this type to know how to release what's passed to it.

Value Members

  1. object CanReleaseResource

    Companion object for CanReleaseResource, providing predefined implicit evidence parameters for withResource().

  2. object Implicits

    Enrichment classes, generally for things in scala.util.

  3. def withResource[T, R](resource: T)(code: (T) ⇒ R)(implicit mgr: CanReleaseResource[T]): R

    Ensure that a closeable object is closed.

    Ensure that a closeable object is closed. Note that this function requires an implicit evidence parameter of type CanClose to determine how to close the object. You can implement your own, though common ones are provided automatically.

    Sample use:

    withResource(new java.io.FileInputStream("/path/to/file")) {
    in => ...
    }
    resource

    the object that holds a resource to be released

    code

    the code block to execute with the resource

    mgr

    the resource manager that can release the resource

    returns

    whatever the block returns

Inherited from AnyRef

Inherited from Any

Ungrouped