pub struct DiffLine { /* private fields */ }
Expand description
Represents a single line in a diff
Implementations§
Source§impl 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 Eq for DiffLine
impl StructuralPartialEq for DiffLine
Auto Trait Implementations§
impl Freeze for DiffLine
impl RefUnwindSafe for DiffLine
impl Send for DiffLine
impl Sync for DiffLine
impl Unpin for DiffLine
impl UnwindSafe for DiffLine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more