pub struct EditorDisplayBuffer {
pub buffer: TextBuffer,
pub caret_byte: usize,
}Expand description
Display buffer used while IME preedit is active.
The buffer is an owned clone with non-empty preedit text inserted at the
clamped caret. caret_byte is a UTF-8 byte offset into that display clone.
§Examples
use ailloli_ui_editor::input::ime::EditorDisplayBuffer;
use ailloli_ui_text::TextBuffer;
let display = EditorDisplayBuffer { buffer: TextBuffer::from_string("é"), caret_byte: 2 };
assert_eq!(display.caret_byte, display.buffer.len_bytes());Fields§
§buffer: TextBufferOriginal text or an IME-preedit augmented clone.
caret_byte: usizeClamped display-buffer caret byte.
Trait Implementations§
Source§impl Clone for EditorDisplayBuffer
impl Clone for EditorDisplayBuffer
Source§fn clone(&self) -> EditorDisplayBuffer
fn clone(&self) -> EditorDisplayBuffer
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EditorDisplayBuffer
impl RefUnwindSafe for EditorDisplayBuffer
impl Send for EditorDisplayBuffer
impl Sync for EditorDisplayBuffer
impl Unpin for EditorDisplayBuffer
impl UnwindSafe for EditorDisplayBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more