mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
50 lines
874 B
Plaintext
50 lines
874 B
Plaintext
module HTTPX::Transcoder
|
|
module Chunker
|
|
CRLF: String
|
|
|
|
class Error < HTTPX::Error
|
|
end
|
|
|
|
def self?.encode: (_Each[String] chunks) -> Encoder
|
|
|
|
class Encoder
|
|
@raw: _Each[String]
|
|
|
|
def each: () { (String) -> void } -> void
|
|
| () -> Enumerator[String, void]
|
|
|
|
private
|
|
|
|
def initialize: (_Each[String] chunks) -> void
|
|
end
|
|
|
|
class Decoder
|
|
extend Forwardable
|
|
include _ToS
|
|
|
|
@buffer: String
|
|
@chunk_length: Integer
|
|
@chunk_buffer: String
|
|
@finished: bool
|
|
@state: Symbol
|
|
@trailers: bool
|
|
|
|
def each: () { (String) -> void } -> void
|
|
|
|
def finished?: () -> bool
|
|
|
|
def empty?: () -> bool
|
|
|
|
def <<: (string) -> void
|
|
|
|
def clear: () -> void
|
|
|
|
private
|
|
|
|
def initialize: (String, ?bool) -> void
|
|
|
|
def nextstate: (Symbol) -> void
|
|
end
|
|
end
|
|
end
|