#[non_exhaustive]pub enum ImePreeditError {
ReversedSelection,
SelectionOutOfBounds,
SelectionNotOnCharBoundary,
}Expand description
Invalid UTF-8 byte selection associated with preedit text.
Possible errors distinguish reversed, out-of-bounds, and non-character- boundary selections.
§Examples
use ailloli_ui_core::event::{ImePreedit, ImePreeditError};
assert_eq!(ImePreedit::try_new("é", Some((1, 2))).unwrap_err(), ImePreeditError::SelectionNotOnCharBoundary);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ReversedSelection
The start byte index is greater than the end index.
SelectionOutOfBounds
The end byte index exceeds the preedit string length.
SelectionNotOnCharBoundary
At least one byte index splits a UTF-8 encoded scalar value.
Trait Implementations§
Source§impl Clone for ImePreeditError
impl Clone for ImePreeditError
Source§fn clone(&self) -> ImePreeditError
fn clone(&self) -> ImePreeditError
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 moreSource§impl Debug for ImePreeditError
impl Debug for ImePreeditError
Source§impl Display for ImePreeditError
impl Display for ImePreeditError
Source§impl Error for ImePreeditError
impl Error for ImePreeditError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for ImePreeditError
impl PartialEq for ImePreeditError
impl Copy for ImePreeditError
impl Eq for ImePreeditError
impl StructuralPartialEq for ImePreeditError
Auto Trait Implementations§
impl Freeze for ImePreeditError
impl RefUnwindSafe for ImePreeditError
impl Send for ImePreeditError
impl Sync for ImePreeditError
impl Unpin for ImePreeditError
impl UnwindSafe for ImePreeditError
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