struct Reader
XuAPI
pub struct Reader {
pub data string
pub sticky string
}用途
公开结构体 `Reader`。
参数
datastring- 数据
stickystring- 字段(string)
API
#compress/zlibzlib Reader/Writer,校验 Adler-32;拒字典。
struct Readerpub struct Reader {
pub data string
pub sticky string
}公开结构体 `Reader`。
data stringsticky stringstruct Writerpub struct Writer {
pub buf string
pub out string
pub closed bool
}公开结构体 `Writer`。
buf stringout stringclosed boolnew_readerpub fn new_reader(data string) Reader构造 reader。
data stringReader — 该类型的值
new_writerpub fn new_writer() Writer构造 writer。
无
Writer — 该类型的值
(&mut Reader) read_allpub fn (r &mut Reader) read_all() string`&mut Reader` 上的方法:读取all。失败时 throw。
r &mut Readerstring — 结果字符串
(&mut Writer) writepub fn (w &mut Writer) write(data &string) int`&mut Writer` 上的方法:写入数据,返回写入的字节数。失败时 throw。
w &mut Writerdata &stringint — 写入的字节数
(&mut Writer) write_stringpub fn (w &mut Writer) write_string(s string) int`&mut Writer` 上的方法:写入字符串,返回写入的字节数。
w &mut Writers stringint — 写入的字节数
(&mut Writer) closepub fn (w &mut Writer) close() int`&mut Writer` 上的方法:关闭资源。
w &mut Writerint — 该类型的值
(&Writer) bytespub fn (w &Writer) bytes() string`&Writer` 上的方法:返回已缓冲的字节串。
w &Writerstring — 结果字符串
(&Writer) textpub fn (w &Writer) text() string`&Writer` 上的方法:返回当前文本。
w &Writerstring — 结果字符串