Struct text_editing::TextLine[][src]

pub struct TextLine { /* fields omitted */ }

The text line represents editable text lines.

Implementations

impl TextLine[src]

pub fn new() -> Self[src]

Creates a new empty text line.

pub fn from_string(text: String) -> Self[src]

Creates a text line from a String.

pub fn from_str(text: &str) -> Self[src]

Creates a text line from a str reference.

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

Checks if the line is empty.

pub fn len(&self) -> usize[src]

Returns the length of the text line.

pub fn to_string(&self) -> String[src]

Returns the text of the text line as String.

pub fn as_str(&self) -> &str[src]

Returns the text of the text line as a str reference.

pub fn string_index(&self, index: usize) -> usize[src]

Converts the character index to the string index.

pub fn char_at(&self, at: usize) -> char[src]

Returns the char at the specified position.

pub fn insert(&mut self, index: usize, c: char)[src]

Inserts a new char into text line.

pub fn remove(&mut self, index: usize) -> char[src]

Removes a char from text line.

pub fn split(&mut self, index: usize) -> Self[src]

Splits a text line into two.

pub fn join(&mut self, other: Self)[src]

Joins two text lines into one.

Trait Implementations

impl Clone for TextLine[src]

Auto Trait Implementations

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.