Skip to main content

Module bytes

Module bytes 

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

定容字节容器:栈上(StackBytes)与堆上(HeapBytes,需 alloc)实现,Drop 与显式擦除均经易失写清零。

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

Structs§

HeapBytesalloc
堆上定容字节容器,语义与 StackBytes 一致,适用于超过栈承载的较大敏感数据。
StackBytes
栈上定容字节容器,Drop 时自动清零,适用于短密钥、非对称 nonce 等小敏感数据。

Enums§

BytesError
字节容器的错误类型。未来可能新增变体/字段,请勿依赖穷尽匹配。

Traits§

Bytes
定容字节容器的统一接口:写入、擦除与向更大容器搬运。

Type Aliases§

BytesResult
字节容器操作的统一返回类型。