pub trait Utf8Data {
// Required method
fn utf8_bytes(&self) -> &[u8] ⓘ;
}
Expand description
Adapter for common Rust string types to ONNX strings.
It should be easy to use both String
and &str
as TensorElementDataType::String
data, but
we can’t define an automatic implementation for anything that implements AsRef<str>
as it
would conflict with the implementations of IntoTensorElementDataType
for primitive numeric
types (which might implement AsRef<str>
at some point in the future).
Required Methods§
sourcefn utf8_bytes(&self) -> &[u8] ⓘ
fn utf8_bytes(&self) -> &[u8] ⓘ
Returns the contents of this value as a slice of UTF-8 bytes.