[−][src]Struct refactory_string::RefactoryString
A RefactoryBuffer specialization that only accepts and returns UTF-8 strings. This is what should be used when modifying a source string/file content. It uses RefactoryBuffer and converts everything conveniently.
Methods
impl<'a> RefactoryString<'a>
[src]
pub fn new(content: &'a str) -> RefactoryString<'a>
[src]
Create a new RefactoryString from the content. Never owns the original content, but owns every changes made to it.
pub fn len(&self) -> usize
[src]
The original length of the content it contains.
pub fn to_string(&self) -> String
[src]
Serialize the changes to a string.
pub fn append_left(&mut self, index: usize, content: &str) -> Result<(), Error>
[src]
Append the content to the left of the index.
pub fn prepend_left(&mut self, index: usize, content: &str) -> Result<(), Error>
[src]
Prepend the content to the left of the index.
pub fn append_right(&mut self, index: usize, content: &str) -> Result<(), Error>
[src]
Append the content to the right of the index.
pub fn prepend_right(
&mut self,
index: usize,
content: &str
) -> Result<(), Error>
[src]
&mut self,
index: usize,
content: &str
) -> Result<(), Error>
Prepend the content to the right of the index.
pub fn prepend(&mut self, content: &str) -> Result<(), Error>
[src]
Prepend the content to the whole RefactoryString.
pub fn append(&mut self, content: &str) -> Result<(), Error>
[src]
Append the content to the whole RefactoryString.
pub fn overwrite(
&mut self,
start: usize,
end: usize,
content: &str
) -> Result<(), Error>
[src]
&mut self,
start: usize,
end: usize,
content: &str
) -> Result<(), Error>
Overwrite the content at the indices [start, end].
pub fn remove(&mut self, start: usize, end: usize) -> Result<(), Error>
[src]
Remove the content between two indices.
Auto Trait Implementations
impl<'a> RefUnwindSafe for RefactoryString<'a>
impl<'a> Send for RefactoryString<'a>
impl<'a> Sync for RefactoryString<'a>
impl<'a> Unpin for RefactoryString<'a>
impl<'a> UnwindSafe for RefactoryString<'a>
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,
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, 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.
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>,