XU XUv0.16.0

#encoding/pem

导入方式: #encoding/pem

公开 API: 2 函数, 1 方法, 1 类型, 0 常量, 0 方法集

PEM decode / encode_to_memory。

struct Block

XuAPI
pub struct Block {
    pub typ string
    pub keys []string
    pub vals []string
    pub bytes string
    pub rest string
}

用途

承载 typ、keys、vals、bytes、rest 等属性的结构体。

公开字段

typ string
字段(string)
keys []string
字段([]string)
vals []string
字段([]string)
bytes string
字段(string)
rest string
字段(string)

decode

XuAPI
pub fn decode(data &string) Block

用途

从编码数据中还原原始数据。

参数

data &string
数据(只读借用,调用方仍持有原值;类型 &string)

返回值

Block — 该类型的值

(Block) header

XuAPI
pub fn (b Block) header(key string) string

用途

Block 上的操作:头。

参数

b Block
本次调用使用的 Block 实例;按值接收。
key string
键(string)

返回值

string — 结果字符串

encode_to_memory

XuAPI
pub fn encode_to_memory(b &Block) string

用途

编码 to memory 数据。

参数

b &Block
b(只读借用,调用方仍持有原值;类型 &Block)

返回值

string — 结果字符串