play.api.mvc

AsyncResult

case class AsyncResult(result: Future[Result]) extends Result with WithHeaders[AsyncResult] with Product with Serializable

An AsyncResult handles a Promise of result for cases where the result is not ready yet.

result

the promise of result, which can be any other result type

Source
Results.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, Result, WithHeaders[AsyncResult], NotNull, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncResult
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Result
  7. WithHeaders
  8. NotNull
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncResult(result: Future[Result])

    result

    the promise of result, which can be any other result type

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def as(contentType: String): AsyncResult

    Changes the result content type.

    Changes the result content type.

    For example:

    Ok("Hello world").as("text/xml")
    contentType

    the new content type.

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def discardingCookies(cookies: DiscardingCookie*): AsyncResult

    Discards cookies along this result.

    Discards cookies along this result.

    For example:

    Ok("Hello world").discardingCookies("theme")
    cookies

    the cookies to discard along to this result

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def flashing(values: (String, String)*): AsyncResult

    Adds values to the flash scope for this result.

    Adds values to the flash scope for this result.

    For example:

    Ok("Hello world").flashing("success" -> "Done!")
    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  13. def flashing(flash: Flash): AsyncResult

    Adds values to the flash scope for this result.

    Adds values to the flash scope for this result.

    For example:

    Ok("Hello world").flashing(flash + ("success" -> "Done!"))
    flash

    the flash scope to set with this result

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. def map(f: (Result) ⇒ Result)(implicit ec: ExecutionContext): AsyncResult

  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. val result: Future[Result]

    the promise of result, which can be any other result type

  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def transform(f: (PlainResult) ⇒ Result)(implicit ec: ExecutionContext): AsyncResult

    Apply some transformation to this AsyncResult

    Apply some transformation to this AsyncResult

    f

    The transformation function

    returns

    The transformed AsyncResult

  23. def unflatten: Future[PlainResult]

  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def withCookies(cookies: Cookie*): AsyncResult

    Adds cookies to this result.

    Adds cookies to this result.

    For example:

    Ok("Hello world").withCookies(Cookie("theme", "blue"))
    cookies

    the cookies to add to this result

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  28. def withHeaders(headers: (String, String)*): AsyncResult

    Adds headers to this result.

    Adds headers to this result.

    For example:

    Ok("Hello world").withHeaders(ETAG -> "0")
    headers

    the headers to add to this result.

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  29. def withLang(lang: Lang)(implicit app: Application): AsyncResult

    Sets the users language permanently for future requests by storing it in a cookie.

    Sets the users language permanently for future requests by storing it in a cookie.

    For example:

    implicit val lang = Lang("fr-FR")
    Ok(Messages("hello.world")).withLang(lang)
    lang

    the language to store for the user

    returns

    the new result

    Definition Classes
    WithHeaders
  30. def withNewSession: AsyncResult

    Discards the existing session for this result.

    Discards the existing session for this result.

    For example:

    Ok("Hello world").withNewSession
    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  31. def withSession(session: (String, String)*): AsyncResult

    Sets a new session for this result, discarding the existing session.

    Sets a new session for this result, discarding the existing session.

    For example:

    Ok("Hello world").withSession("saidHello" -> "yes")
    session

    the session to set with this result

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders
  32. def withSession(session: Session): AsyncResult

    Sets a new session for this result.

    Sets a new session for this result.

    For example:

    Ok("Hello world").withSession(session + ("saidHello" -> "true"))
    session

    the session to set with this result

    returns

    the new result

    Definition Classes
    AsyncResultWithHeaders

Deprecated Value Members

  1. def discardingCookies(name: String, names: String*): AsyncResult

    Discards cookies along this result.

    Discards cookies along this result.

    For example:

    Ok("Hello world").discardingCookies("theme")
    names

    the names of the cookies to discard along to this result

    returns

    the new result

    Definition Classes
    WithHeaders
    Annotations
    @deprecated
    Deprecated

    (Since version 2.1) This method can only discard cookies on the / path with no domain and without secure set. Use discardingCookies(DiscardingCookie*) instead.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Result

Inherited from WithHeaders[AsyncResult]

Inherited from NotNull

Inherited from AnyRef

Inherited from Any

Ungrouped