pub struct Editor(/* private fields */);Expand description
A multi-line text editor.
Implementations§
Trait Implementations§
Source§impl Editor for Editor
impl Editor for Editor
Source§fn line(&self, index: usize) -> Option<Line<'_>>
fn line(&self, index: usize) -> Option<Line<'_>>
Returns the text of the given line in the [
Editor], if it exists.Source§fn line_count(&self) -> usize
fn line_count(&self) -> usize
Returns the amount of lines in the [
Editor].Source§fn min_bounds(&self) -> Size
fn min_bounds(&self) -> Size
Returns the minimum boundaries to fit the current contents of
the [
Editor].Source§fn hint_factor(&self) -> Option<f32>
fn hint_factor(&self) -> Option<f32>
Returns the hint factor of the [
Editor].Source§fn update(
&mut self,
new_bounds: Size,
new_font: Font,
new_size: Pixels,
new_line_height: LineHeight,
new_wrapping: Wrapping,
new_alignment: Alignment,
new_hint_factor: Option<f32>,
new_highlighter: &mut impl Highlighter,
)
fn update( &mut self, new_bounds: Size, new_font: Font, new_size: Pixels, new_line_height: LineHeight, new_wrapping: Wrapping, new_alignment: Alignment, new_hint_factor: Option<f32>, new_highlighter: &mut impl Highlighter, )
Updates the [
Editor] with some new attributes.Source§fn highlight<H: Highlighter>(
&mut self,
font: Self::Font,
highlighter: &mut H,
format_highlight: impl Fn(&H::Highlight) -> Format<Self::Font>,
)
fn highlight<H: Highlighter>( &mut self, font: Self::Font, highlighter: &mut H, format_highlight: impl Fn(&H::Highlight) -> Format<Self::Font>, )
Runs a text [
Highlighter] in the [Editor].Source§fn line_height(&self) -> LineHeight
fn line_height(&self) -> LineHeight
Returns the current [
LineHeight] of the [Editor].impl StructuralPartialEq for Editor
Auto Trait Implementations§
impl Freeze for Editor
impl RefUnwindSafe for Editor
impl Send for Editor
impl Sync for Editor
impl Unpin for Editor
impl UnsafeUnpin for Editor
impl UnwindSafe for Editor
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().§impl<T> TextInput for Twhere
T: Editor,
impl<T> TextInput for Twhere
T: Editor,
§fn move_cursor_to_front(&mut self)
fn move_cursor_to_front(&mut self)
Moves the cursor of the text input to the front of the input text.
§fn move_cursor_to_end(&mut self)
fn move_cursor_to_end(&mut self)
Moves the cursor of the text input to the end of the input text.
§fn move_cursor_to(&mut self, position: Position)
fn move_cursor_to(&mut self, position: Position)
Moves the cursor of the text input to an arbitrary location.
§fn select_all(&mut self)
fn select_all(&mut self)
Selects all the content of the text input.
§fn select_range(&mut self, start: Position, end: Position)
fn select_range(&mut self, start: Position, end: Position)
Selects the given content range of the text input.