Struct text_editing::TextLine [−][src]
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
Auto Trait Implementations
impl RefUnwindSafe for TextLine
impl Send for TextLine
impl Sync for TextLine
impl Unpin for TextLine
impl UnwindSafe for TextLine
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,