pub enum LineEnd {
SoftWrap,
HardBreak {
chars: u8,
bytes: u8,
},
EndOfText,
}Expand description
How a laid-out line ends.
A screen reader distinguishes a paragraph break (which it announces and which occupies a character in the accessible text) from a soft wrap (which occupies nothing).
Variants§
SoftWrap
The line was broken to fit the wrap width. Nothing in the source separates it from the next line.
HardBreak
The line ends with an explicit break in the source: a \n, a \r\n,
or any other hard line break of UAX #14 (a carriage return, next
line, vertical tab, form feed, paragraph separator, or the line
separator U+2028 a word processor inserts for Shift+Enter).
chars is how many source characters the break occupies (1, or 2
for \r\n); bytes is how many source bytes it occupies (1 for
\n, 2 for \r\n, 3 for U+2028). AccessKit counts a \r\n as a
single character whose character_lengths entry is 2 — that is
bytes.
EndOfText
The line ends because the source does.
Trait Implementations§
impl Copy for LineEnd
impl Eq for LineEnd
impl StructuralPartialEq for LineEnd
Auto Trait Implementations§
impl Forget for LineEnd
impl Freeze for LineEnd
impl Move for LineEnd
impl RefUnwindSafe for LineEnd
impl Send for LineEnd
impl Sync for LineEnd
impl Unpin for LineEnd
impl UnsafeUnpin for LineEnd
impl UnwindSafe for LineEnd
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.