def whole.of

emerging-ezhttp@0.21.0.0 · src/http.bend:1346

import emerging-ezhttp@0.21.0.0/src/http.bend as Http
import Base

1346# whether a body has all arrived under its framing
1347def whole.of(f: Frame, +body: String) -> Bool:
1348  match f:
1349    case Bare{}:
1350      True{}
1351    case Sized{n}:
1352      Bool.not(Nat.is_lt(octs.len(body), n))
1353    case Chunked{}:
1354      chunks.ended(String.length(body), divide(body, "\r\n"))
1355    case Closed{}:
1356      False{}

Uses (9)

Used by (1)