Trait ort::tensor::Utf8Data

source ·
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§

source

fn utf8_bytes(&self) -> &[u8]

Returns the contents of this value as a slice of UTF-8 bytes.

Implementations on Foreign Types§

source§

impl Utf8Data for String

source§

fn utf8_bytes(&self) -> &[u8]

source§

impl<'a> Utf8Data for &'a str

source§

fn utf8_bytes(&self) -> &[u8]

Implementors§