[−][src]Struct nvimpam_lib::lines::Lines
The struct to hold the lines.
Methods
impl<'a> Lines<'a>[src]
impl<'a> Lines<'a>pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeReturns the number of lines
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolCheck if there are any lines
pub fn from_vec(v: Vec<String>) -> Lines<'a>[src]
pub fn from_vec(v: Vec<String>) -> Lines<'a>Create a new Lines struct from a Vec<String>
pub fn from_strs(v: &'a [&'a str]) -> Lines<'a>[src]
pub fn from_strs(v: &'a [&'a str]) -> Lines<'a>Creates a new Lines struct from a slice of &'strs
pub fn from_slice(v: &'a [u8]) -> Lines<'a>[src]
pub fn from_slice(v: &'a [u8]) -> Lines<'a>Create a new Lines struct from a byte slice by splitting on newlines.
pub fn read_file<P: AsRef<Path>>(path: P) -> Result<Vec<u8>, Error>[src]
pub fn read_file<P: AsRef<Path>>(path: P) -> Result<Vec<u8>, Error>Read a file into a Vec<u8>. For usage with
from_slice.
pub fn update(&mut self, first: usize, last: usize, linedata: Vec<String>)[src]
pub fn update(&mut self, first: usize, last: usize, linedata: Vec<String>)Update Lines:
firstandlastare zero-indexed (just as Lines itself)lastis the first line that has not been updated This are the exact conditions to use the rangefirst..lasttogether withspliceon aVec.
ⓘImportant traits for LinesIter<'a, I>pub fn iter(
&'a self
) -> LinesIter<'a, impl Iterator<Item = &'a Line<'a>>>[src]
pub fn iter(
&'a self
) -> LinesIter<'a, impl Iterator<Item = &'a Line<'a>>>Return an Iterator over the lines of a file.
Trait Implementations
impl<'a> Default for Lines<'a>[src]
impl<'a> Default for Lines<'a>impl<'a> From<Vec<String>> for Lines<'a>[src]
impl<'a> From<Vec<String>> for Lines<'a>impl<'a> Deref for Lines<'a>[src]
impl<'a> Deref for Lines<'a>type Target = [Line<'a>]
The resulting type after dereferencing.
fn deref(&self) -> &[Line<'a>][src]
fn deref(&self) -> &[Line<'a>]Dereferences the value.
impl<'a> Debug for Lines<'a>[src]
impl<'a> Debug for Lines<'a>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a> Display for Lines<'a>[src]
impl<'a> Display for Lines<'a>Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more