Struct embedded_text::rendering::cursor::Cursor
source · pub struct Cursor<F: Font> {
pub position: Point,
/* private fields */
}Expand description
Internal structure that keeps track of rendering a [TextBox].
Fields§
§position: PointCurrent cursor position
Implementations§
source§impl<F: Font> Cursor<F>
impl<F: Font> Cursor<F>
sourcepub fn new(bounds: Rectangle) -> Self
pub fn new(bounds: Rectangle) -> Self
Creates a new Cursor located at the top left of the bounding box.
sourcepub fn line_width(&self) -> u32
pub fn line_width(&self) -> u32
Returns the width of the textbox
sourcepub fn carriage_return(&mut self)
pub fn carriage_return(&mut self)
Moves the cursor back to the start of the line.
sourcepub fn in_display_area(&self) -> bool
pub fn in_display_area(&self) -> bool
Returns whether the cursor is in the bounding box.
Note: Only vertical overrun is checked.
sourcepub fn fits_in_line(&self, width: u32) -> bool
pub fn fits_in_line(&self, width: u32) -> bool
Returns whether the current line has enough space to also include an object of given width.
Trait Implementations§
impl<F: Copy + Font> Copy for Cursor<F>
Auto Trait Implementations§
impl<F> Freeze for Cursor<F>
impl<F> RefUnwindSafe for Cursor<F>where
F: RefUnwindSafe,
impl<F> Send for Cursor<F>where
F: Send,
impl<F> Sync for Cursor<F>where
F: Sync,
impl<F> Unpin for Cursor<F>where
F: Unpin,
impl<F> UnwindSafe for Cursor<F>where
F: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)