[][src]Struct embedded_text::rendering::cursor::Cursor

pub struct Cursor<F: Font> {
    pub position: Point,
    // some fields omitted
}

Internal structure that keeps track of rendering a [TextBox].

Fields

position: Point

Current cursor position

Implementations

impl<F: Font> Cursor<F>[src]

#[must_use]pub fn new(bounds: Rectangle) -> Self[src]

Creates a new Cursor located at the top left of the bounding box.

pub fn line_width(&self) -> u32[src]

Returns the width of the textbox

pub fn new_line(&mut self)[src]

Starts a new line.

pub fn carriage_return(&mut self)[src]

Moves the cursor back to the start of the line.

pub fn in_display_area(&self) -> bool[src]

Returns whether the cursor is in the bounding box.

Note: Only vertical overrun is checked.

pub fn fits_in_line(&self, width: u32) -> bool[src]

Returns whether the current line has enough space to also include an object of given width.

pub fn advance(&mut self, by: u32)[src]

Advances the cursor by a given amount.

Trait Implementations

impl<F: Clone + Font> Clone for Cursor<F>[src]

impl<F: Copy + Font> Copy for Cursor<F>[src]

impl<F: Debug + Font> Debug for Cursor<F>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.