const STORE
pub const STORE = 0Purpose
Constant STORE, defining protocol or algorithm parameters.
#archive/zipzip Reader/Writer (Store and deflate). No ZIP64.
const STOREpub const STORE = 0Constant STORE, defining protocol or algorithm parameters.
const DEFLATEpub const DEFLATE = 8Constant DEFLATE, defining protocol or algorithm parameters.
struct Filepub struct File {
pub name string
pub method int
pub crc32 int
pub compressed_size int
pub uncompressed_size int
pub body string
}Structure encapsulating name, method, crc32, compressed_size, uncompressed_size.
name stringmethod intcrc32 intcompressed_size intuncompressed_size intbody stringstruct Readerpub struct Reader {
pub data string
pub pos int
}Zip Streaming reader and decoder.
data stringpos intstruct Writerpub struct Writer {
pub buf string
pub names []string
pub methods []int
pub crcs []int
pub comps []int
pub uncomps []int
pub offsets []int
pub closed int
pub comment string
}Zip Streaming writer and encoder.
buf stringnames []stringmethods []intcrcs []intcomps []intuncomps []intoffsets []intclosed intcomment stringnew_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
($&Writer) set_commentpub fn (w $&Writer) set_comment(s string)Operation on $&Writer: set comment.
w $&WriterWriter instance used by this call (exclusive borrow).s stringThis call does not return a value.
(&Writer) file_countpub fn (w &Writer) file_count() intOperation on &Writer: file count.
w &WriterWriter instance used by this call (borrow).int — a value of this type
commentpub fn comment(data &string) stringExecute comment. Throws on failure; handle the error or propagate it to the caller.
data &stringstring — result string
(&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) write_filepub fn (w $&Writer) write_file(name &string, body &string) intOperation on $&Writer: write file.
w $&WriterWriter instance used by this call (exclusive borrow).name &stringbody &stringint — a value of this type
($&Writer) write_file_deflatepub fn (w $&Writer) write_file_deflate(name &string, body &string) intOperation on $&Writer: write file deflate.
w $&WriterWriter instance used by this call (exclusive borrow).name &stringbody &stringint — a value of this type
($&Writer) closepub fn (w $&Writer) close() intOperation on $&Writer: close the resource. Throws on failure; handle the error or propagate it to the caller.
w $&WriterWriter instance used by this call (exclusive borrow).int — a value of this type
($&Reader) nextpub fn (r $&Reader) next() FileOperation on $&Reader: take the next item, or end according to this type. Throws on failure; handle the error or propagate it to the caller.
r $&ReaderReader instance used by this call (exclusive borrow).File — a value of this type