fn bytesOf
The UTF-8 bytes of a string: decode<T>(bytesOf(text), Format.Json).
Example:
use std.ser { bytesOf }
fn main() io {
print("{bytesOf(&"abc").len()}")
}Output
3
@intrinsic("ser.bytesOf") pub(api) fn bytesOf(s: &str) -> bytesSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
s | &str |
Returns
bytes
Effects
none declared (pure unless the body says otherwise)
Defined in: std/ser/ser.oxl:2321