Struct epaint::Galley[][src]

pub struct Galley {
    pub text_style: TextStyle,
    pub text: String,
    pub rows: Vec<Row>,
    pub size: Vec2,
}

A collection of text locked into place.

Fields

text_style: TextStyle

The crate::TextStyle (font) used.

text: String

The full text, including any an all \n.

rows: Vec<Row>

Rows of text, from top to bottom. The number of chars in all rows sum up to text.chars().count(). Note that each paragraph (pieces of text separated with \n) can be split up into multiple rows.

size: Vec2

Implementations

impl Galley[src]

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

pub fn sanity_check(&self)[src]

impl Galley[src]

pub fn pos_from_pcursor(&self, pcursor: PCursor) -> Rect[src]

Returns a 0-width Rect.

pub fn pos_from_cursor(&self, cursor: &Cursor) -> Rect[src]

Returns a 0-width Rect.

pub fn cursor_from_pos(&self, pos: Vec2) -> Cursor[src]

Cursor at the given position within the galley

impl Galley[src]

pub fn end(&self) -> Cursor[src]

Cursor to one-past last character.

pub fn end_rcursor(&self) -> RCursor[src]

impl Galley[src]

pub fn from_ccursor(&self, ccursor: CCursor) -> Cursor[src]

pub fn from_rcursor(&self, rcursor: RCursor) -> Cursor[src]

pub fn from_pcursor(&self, pcursor: PCursor) -> Cursor[src]

impl Galley[src]

pub fn cursor_left_one_character(&self, cursor: &Cursor) -> Cursor[src]

pub fn cursor_right_one_character(&self, cursor: &Cursor) -> Cursor[src]

pub fn cursor_up_one_row(&self, cursor: &Cursor) -> Cursor[src]

pub fn cursor_down_one_row(&self, cursor: &Cursor) -> Cursor[src]

pub fn cursor_begin_of_row(&self, cursor: &Cursor) -> Cursor[src]

pub fn cursor_end_of_row(&self, cursor: &Cursor) -> Cursor[src]

Trait Implementations

impl Clone for Galley[src]

fn clone(&self) -> Galley[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Galley[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<Galley> for Galley[src]

fn eq(&self, other: &Galley) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Galley) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for Galley[src]

Auto Trait Implementations

impl RefUnwindSafe for Galley

impl Send for Galley

impl Sync for Galley

impl Unpin for Galley

impl UnwindSafe for Galley

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.