input.bend relies on unsafe/foreign
raw source on the hub · import bend-kit-camber@0.16.0.3/input.bend as Input
Checked typed inputs; bodies are consumed once, without caching or decompression.
7 imports
import Base import bend-kit-http@0.39.1.0/http.bend as Http import bend-kit-router@0.2.0.0/target.bend as Target import bend-kit-json@0.7.2.0/json.bend as Json import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes import bend-kit-url@0.4.1.0/url.bend as Url import ./response.bend as Response
Definitions
def decimal.step source · line 16 · raw
@ok:Bool -> @+acc:U32 -> @digit:U32 -> @next:(@_:U32 -> Maybe<&2, U32>) -> Maybe<&2, U32>
def decimal.go source · line 21 · raw
@text:String -> @+acc:U32 -> Maybe<&2, U32>
def u32 source · line 29 · raw
@text:String -> Maybe<&2, U32>
Nonempty ASCII decimal only; arithmetic happens only after the overflow guard.
def query.keep source · line 57 · raw
@same:Bool -> @value:String -> @rest:List<&2, String> -> List<&2, String>
def query.values source · line 61 · raw
@xs:List<&2, 0x9606cc4b1afb0de13a7da7c0f6fc3a82/target.Query> -> @+key:String -> List<&2, String>
def utf8.step source · line 89 · raw
@pair:Pair(Array<U32>, U32) -> @state:0x9606cc4b1afb0de13a7da7c0f6fc3a82/target.Utf -> Pair(Array<U32>, Maybe<&2, 0x9606cc4b1afb0de13a7da7c0f6fc3a82/target.Utf>)
Reuse Target's RFC 3629 state machine directly over the owned packed array.
def utf8.go source · line 94 · raw
@fuel:Nat -> @pair:Pair(Array<U32>, Maybe<&2, 0x9606cc4b1afb0de13a7da7c0f6fc3a82/target.Utf>) -> @+index:U32 -> Pair(Array<U32>, Maybe<&2, String>)
def utf8.borrowed source · line 105 · raw
@len:U32 -> @pair:Pair(Array<U32>, Maybe<&2, String>) -> Pair(0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body, Maybe<&2, String>)
def utf8.borrow source · line 109 · raw
@bytes:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Pair(0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body, Maybe<&2, String>)
def utf8.text source · line 113 · raw
@pair:Pair(0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body, Maybe<&2, String>) -> Maybe<&2, String>
def utf8 source · line 117 · raw
@bytes:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Maybe<&2, String>
def media.part source · line 121 · raw
@split:Bool -> @+c:U32 -> @+quoted:Bool -> @+escaped:Bool -> @acc:String -> @parts:List<&2, String> -> Pair(Bool, Pair(Bool, Pair(String, List<&2, String>)))
Split only unquoted semicolons, retaining quoted parameter syntax for checks.
def media.end source · line 127 · raw
@invalid:Bool -> @acc:String -> @parts:List<&2, String> -> List<&2, String>
def media.parts source · line 132 · raw
@text:String -> @state:Pair(Bool, Pair(Bool, Pair(String, List<&2, String>))) -> List<&2, String>
def media.charset.quoted source · line 142 · raw
@text:String -> @expected:String -> @escaped:Bool -> Bool
Compare the decoded quoted-string charset without allocating a second value.
def media.charset.start source · line 159 · raw
@quoted:Bool -> @c:U32 -> @rest:String -> Bool
def media.charset.value source · line 164 · raw
@value:String -> Bool
def media.parameter source · line 169 · raw
@pair:Pair(String, String) -> Bool
def media.charset source · line 175 · raw
@parts:List<&2, String> -> Bool
def media.type source · line 180 · raw
@json:Bool -> @+name:String -> Bool
def media.content source · line 187 · raw
@json:Bool -> @parts:List<&2, String> -> Bool
def media.encoding source · line 192 · raw
@values:List<&2, String> -> Bool
def media.headers source · line 197 · raw
@json:Bool -> @types:List<&2, String> -> @encodings:List<&2, String> -> Bool
def media source · line 202 · raw
@json:Bool -> @+headers:Map<&2, List<&2, String>> -> Bool
def raw source · line 205 · raw
@body:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Result<&2, &1, U32, 0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body>
def text.accepted source · line 208 · raw
@accepted:Bool -> @body:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Result<&2, &1, U32, String>
def text source · line 213 · raw
@headers:Map<&2, List<&2, String>> -> @body:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Result<&2, &1, U32, String>
def json.accepted source · line 216 · raw
@accepted:Bool -> @cap:U32 -> @body:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Result<&2, &1, U32, 0x9d03a1a34430d43e5d09adba8724f726/json.Val>
def json.with_depth source · line 221 · raw
@headers:Map<&2, List<&2, String>> -> @body:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> @cap:U32 -> Result<&2, &1, U32, 0x9d03a1a34430d43e5d09adba8724f726/json.Val>
def json source · line 224 · raw
@headers:Map<&2, List<&2, String>> -> @body:0x90ae486dd8dd7cc6f997dd8abb36dbd8/http.Body -> Result<&2, &1, U32, 0x9d03a1a34430d43e5d09adba8724f726/json.Val>
def number.u32 source · line 228 · raw
@value:0x9d03a1a34430d43e5d09adba8724f726/json.Val -> Result<&2, &1, U32, U32>
Exact number text remains packed until this explicit checked conversion.
Templates
template checked source · line 11 · raw
@-I:Type -> @value:Maybe<&1, I> -> Result<&2, &1, U32, I>
Expected HTTP status, not an exception; the dispatch executor maps it once.
template scalar.convert source · line 34 · raw
@-I:Data -> @value:Maybe<&2, I> -> Result<&2, &1, U32, I>
template path.value source · line 39 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @pair:Pair(Map<&2, String>, String) -> Result<&2, &1, U32, I>
template path.present source · line 43 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @present:Bool -> @params:Map<&2, String> -> @key:String -> Result<&2, &1, U32, I>
template path.found source · line 49 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @key:String -> @pair:Pair(Map<&2, String>, Bool) -> Result<&2, &1, U32, I>
template path source · line 53 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @params:Map<&2, String> -> @+key:String -> Result<&2, &1, U32, I>
template scalar.values source · line 68 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @values:List<&2, String> -> Result<&2, &1, U32, I>
template query.scalar source · line 73 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @query:List<&2, 0x9606cc4b1afb0de13a7da7c0f6fc3a82/target.Query> -> @key:String -> Result<&2, &1, U32, I>
template list.values source · line 76 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @values:List<&2, String> -> Result<&2, &1, U32, List<&2, I>>
template query.list source · line 85 · raw
@-I:Data -> @-convert:(@_:String -> Maybe<&2, I>) -> @query:List<&2, 0x9606cc4b1afb0de13a7da7c0f6fc3a82/target.Query> -> @key:String -> Result<&2, &1, U32, List<&2, I>>