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

org.http4s.blaze.http.http20.package.scala Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
package org.http4s.blaze.http

package object http20 {

  /** Result type of many of the codec methods */
  sealed trait Http2Result
  case object Halt extends Http2Result
  case object BufferUnderflow extends Http2Result

  /** Represents the possibility of failure */
  sealed trait MaybeError extends Http2Result              { def          success: Boolean }
  case object Continue extends MaybeError                  { override def success: Boolean = true }
  case class Error(err: Http2Exception) extends MaybeError { override def success: Boolean = false }

  //////////////////////////////////////////////////

  /** object representing the contents of a PRIORITY frame
    *
    * This is also used for the HEADERS frame which is logically
    * a series of headers with a possible PRIORITY frame
    */
  case class Priority(dependentStreamId: Int, exclusive: Boolean, priority: Int) {
    require(dependentStreamId >= 0, "Invalid stream dependency")
    require(priority > 0 && priority <= 256, "Weight must be 1 to 256")
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy