~/bend-docscommunity

http1/bytes.bend checks

raw source on the hub · import 0x4198ac9516630627ad267983294b8fad/http1/bytes.bend as Bytes

1 import
import Base

Types

type Bytes source · line 10 · raw

Data

bytes as a list of their own: a List<U32> read and then used again makes Lists reference counted (the compiler takes a generic list's cells to read them); a list type of its own is read without taking it

Definitions

def rev.go source · line 14 · raw

@bs:Bytes -> @acc:Bytes -> Bytes

def rev source · line 21 · raw

@bs:Bytes -> Bytes

def app source · line 24 · raw

@a:Bytes -> @b:Bytes -> Bytes

def of_list.go source · line 27 · raw

@xs:List<&2, U32> -> @acc:Bytes -> Bytes

def of_list source · line 35 · raw

@xs:List<&2, U32> -> Bytes

from the List<U32> a socket gives

def to_list.go source · line 38 · raw

@bs:Bytes -> @acc:List<&2, U32> -> List<&2, U32>

def to_list source · line 46 · raw

@bs:Bytes -> List<&2, U32>

to the List<U32> a socket takes

def is_digit.x source · line 49 · raw

@+b:U32 -> Bool

def is_digit source · line 52 · raw

@b:U32 -> Bool

def is_alpha.x source · line 55 · raw

@+b:U32 -> Bool

def is_alpha source · line 58 · raw

@b:U32 -> Bool

def is_tchar.x source · line 61 · raw

@+b:U32 -> Bool

def is_tchar source · line 68 · raw

@b:U32 -> Bool

a token char (RFC 9110 §5.6.2): ! # $ % & ' * + - . ^ _ ` | ~ digits letters

def is_ctl.x source · line 71 · raw

@+b:U32 -> Bool

def is_ctl source · line 75 · raw

@b:U32 -> Bool

a control char, other than tab: never in a field value (RFC 9110 §5.5)

def is_ws.x source · line 78 · raw

@+b:U32 -> Bool

def is_ws source · line 81 · raw

@b:U32 -> Bool

def nonempty source · line 84 · raw

@bs:Bytes -> Bool

def tokens.go source · line 93 · raw

@bs:Bytes -> @ok:Bool -> Bool

plain loops, not a template: the compiler reads a list through a plain loop without taking it, so the caller can use the list again

def is_token source · line 101 · raw

@+bs:Bytes -> Bool

a non-empty run of token chars

def value.go source · line 104 · raw

@bs:Bytes -> @ok:Bool -> Bool

def value_ok source · line 111 · raw

@bs:Bytes -> Bool

def head_ws source · line 114 · raw

@bs:Bytes -> Bool

def drop_ws source · line 122 · raw

@bs:Bytes -> Bytes

bs without leading spaces and tabs