unicode_bidi

Trait TextSource

Source
pub trait TextSource<'text>: Sealed {
    type CharIter: Iterator<Item = char>;
    type CharIndexIter: Iterator<Item = (usize, char)>;
    type IndexLenIter: Iterator<Item = (usize, usize)>;
}
Expand description

Trait that abstracts over a text source for use by the bidi algorithms. We implement this for str (UTF-8) and for u16 (UTF-16, native-endian). (For internal unicode-bidi use; API may be unstable.) This trait is sealed and cannot be implemented for types outside this crate.

Required Associated Types§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'text> TextSource<'text> for str

Implementation of TextSource for UTF-8 text (a string slice).

Source§

impl<'text> TextSource<'text> for [u16]

Implementors§