Skip to main content

EditorParagraph

Struct EditorParagraph 

Source
pub struct EditorParagraph<'a> { /* private fields */ }
Expand description

One laid out paragraph of an editor.

Implementations§

Source§

impl EditorParagraph<'_>

Source

pub fn stamp(&self) -> u64

Returns the stamp the paragraph’s layout was built under, which changes when the paragraph is laid out again.

Source

pub fn offset(&self) -> Point

Returns where the paragraph’s top left corner sits, relative to the top left of the text, in logical pixels.

Source

pub fn size(&self) -> Size

Returns the width and height of the laid out paragraph in logical pixels.

Source

pub fn glyph_runs_at(&self, origin: Point, color: Color) -> Vec<GlyphRun>

Converts the paragraph into glyph runs at origin, in paint order, with every run in color.

origin is where the top left corner of the paragraph goes, in the caller’s paint coordinates.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for EditorParagraph<'a>

§

impl<'a> !UnwindSafe for EditorParagraph<'a>

§

impl<'a> Forget for EditorParagraph<'a>

§

impl<'a> Freeze for EditorParagraph<'a>

§

impl<'a> Move for EditorParagraph<'a>

§

impl<'a> Send for EditorParagraph<'a>

§

impl<'a> Sync for EditorParagraph<'a>

§

impl<'a> Unpin for EditorParagraph<'a>

§

impl<'a> UnsafeUnpin for EditorParagraph<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.