Skip to main content

Module str

Module str 

Source
Available on crate features types-str and types only.
Expand description

定容 UTF-8 字符串容器:栈上(StackStr)与堆上(HeapStr,需 alloc)实现,写入时校验编码,源缓冲按需擦除。

需要启用 "types-str" 特性。

Structs§

HeapStralloc
堆上定容安全字符串,语义与 StackStr 一致,适用于较长的敏感文本。
StackStr
栈上定容安全字符串,Drop 时自动清零,适用于短口令、令牌等小敏感文本。

Enums§

StrError
安全字符串的错误类型。

Traits§

Str
安全字符串的统一接口:只读视图,内部恒为合法 UTF-8。