struct Reader
pub struct Reader {
pub data string
pub sticky string
}Purpose
Zlib Streaming reader and decoder.
Public fields
datastring- data
stickystring- field (string)
#compress/zlibzlib Reader/Writer with Adler-32; dictionaries rejected.
struct Readerpub struct Reader {
pub data string
pub sticky string
}Zlib Streaming reader and decoder.
data stringsticky stringstruct Writerpub struct Writer {
pub buf string
pub out string
pub closed bool
}Zlib Streaming writer and encoder.
buf stringout stringclosed boolnew_readerpub fn new_reader(data string) ReaderConstruct reader.
data stringReader — a value of this type
new_writerpub fn new_writer() WriterConstruct writer.
No arguments are required.
Writer — a value of this type
($&Reader) read_allpub fn (r $&Reader) read_all() stringOperation on $&Reader: read all. Throws on failure; handle the error or propagate it to the caller.
r $&ReaderReader instance used by this call (exclusive borrow).string — result string
($&Writer) writepub fn (w $&Writer) write(data &string) intOperation on $&Writer: write data and return the byte count. Throws on failure; handle the error or propagate it to the caller.
w $&WriterWriter instance used by this call (exclusive borrow).data &stringint — bytes written
($&Writer) write_stringpub fn (w $&Writer) write_string(s string) intOperation on $&Writer: write a string and return the byte count.
w $&WriterWriter instance used by this call (exclusive borrow).s stringint — bytes written
($&Writer) closepub fn (w $&Writer) close() intOperation on $&Writer: close the resource.
w $&WriterWriter instance used by this call (exclusive borrow).int — a value of this type
(&Writer) bytespub fn (w &Writer) bytes() stringOperation on &Writer: return the buffered bytes.
w &WriterWriter instance used by this call (borrow).string — result string
(&Writer) textpub fn (w &Writer) text() stringOperation on &Writer: return the current text.
w &WriterWriter instance used by this call (borrow).string — result string
compress_bytespub fn compress_bytes(src &[]u8) []u8Compress bytes.
src &[]u8[]u8 — slice result
decompress_bytespub fn decompress_bytes(src &[]u8) []u8Decompress bytes. Throws on failure; handle the error or propagate it to the caller.
src &[]u8[]u8 — slice result