fn textOf
The text of UTF-8 bytes: textOf(encode(x, Format.Json)).
Example:
use std.ser { bytesOf, textOf }
fn main() io {
print(textOf(&bytesOf(&"ok"))!)
}Вывод
ok
@intrinsic("ser.textOf") pub(api) fn textOf(b: &bytes) -> str | DecodeErrorС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
b | &bytes |
Возвращает
str
Ошибки
DecodeError@error
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/ser/ser.oxl:2336