pub struct DiffLine { /* private fields */ }Expand description
Represents a single line in a diff
Implementations
sourceimpl DiffLine
impl DiffLine
sourcepub fn new(
origin: Origin,
line: &str,
old_line_number: Option<u32>,
new_line_number: Option<u32>,
end_of_file: bool
) -> Self
pub fn new(
origin: Origin,
line: &str,
old_line_number: Option<u32>,
new_line_number: Option<u32>,
end_of_file: bool
) -> Self
Create a new DiffLine.
sourcepub const fn old_line_number(&self) -> Option<u32>
pub const fn old_line_number(&self) -> Option<u32>
Get the old line number of the DiffLine, if it exists, else None.
sourcepub const fn new_line_number(&self) -> Option<u32>
pub const fn new_line_number(&self) -> Option<u32>
Get the new line number of the DiffLine, if it exists, else None.
sourcepub const fn end_of_file(&self) -> bool
pub const fn end_of_file(&self) -> bool
Returns true is this line was at the end of a file, else false.
Trait Implementations
impl StructuralPartialEq for DiffLine
Auto Trait Implementations
impl RefUnwindSafe for DiffLine
impl Send for DiffLine
impl Sync for DiffLine
impl Unpin for DiffLine
impl UnwindSafe for DiffLine
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more