Value
Represents one value of the Range
request header.
enum Value
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
Represents one value of the Range
request header.
enum Value
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
import NIOHTTP1
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct Range
Represents the HTTP Range
request header. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
struct HTTPHeaders
A representation of a block of HTTP header fields.
case start(value: Int)
Integer with single trailing dash, e.g. 25-
case tail(value: Int)
Integer with single leading dash, e.g. -25
case within(start: Int, end: Int)
Two integers with single dash in between, e.g. 20-25
init(unit: RangeUnit, ranges: [HTTPHeaders.Range.Value])
let ranges: [HTTPHeaders.Range.Value]
let unit: RangeUnit
func serialize() -> String
protocol Equatable
A type that can be compared for value equality.
protocol Sendable
static func from<T>(requestStr: T) -> HTTPHeaders.Range.Value? where T : StringProtocol
Parses a string representing a requested range in one of the following formats:
func asResponseContentRange(limit: Int) throws -> HTTPHeaders.ContentRange.Value
Converts this HTTPHeaders.Range.Value
to a HTTPHeaders.ContentRange.Value
with the given limit
.
func serialize() -> String
Serializes HTTPHeaders.Range.Value
to a string for use within the HTTP Range
header.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.