pub enum CursorShape {
Bar,
Block,
Underline,
Custom(CursorPainter),
}Expand description
How the caret renders. Custom’s painter receives the caret’s
world-space rect (position + the field’s own line height) and paints
whatever it wants — the default shapes below are themselves just
convenience presets a Custom painter could fully replicate.
Variants§
Bar
A thin vertical bar at the caret position — the universal default.
Block
A filled block spanning to the next glyph boundary (or a fallback width at end-of-line) — the classic terminal/overwrite-mode caret.
Underline
A thin bar at the BOTTOM of the line instead of a vertical stroke.
Custom(CursorPainter)
App-supplied painter: Fn(&mut PaintCtx, caret_rect).
Trait Implementations§
Source§impl Clone for CursorShape
impl Clone for CursorShape
Source§fn clone(&self) -> CursorShape
fn clone(&self) -> CursorShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CursorShape
impl Debug for CursorShape
Auto Trait Implementations§
impl !RefUnwindSafe for CursorShape
impl !UnwindSafe for CursorShape
impl Freeze for CursorShape
impl Send for CursorShape
impl Sync for CursorShape
impl Unpin for CursorShape
impl UnsafeUnpin for CursorShape
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