pub struct CodeChangeLine { /* private fields */ }Expand description
One bounded, line-numbered source line in a diff hunk.
Implementations§
Source§impl CodeChangeLine
impl CodeChangeLine
Sourcepub fn new(
kind: CodeChangeLineKind,
old_line: Option<u32>,
new_line: Option<u32>,
text: impl Into<String>,
) -> Result<Self, CodeChangeValidationError>
pub fn new( kind: CodeChangeLineKind, old_line: Option<u32>, new_line: Option<u32>, text: impl Into<String>, ) -> Result<Self, CodeChangeValidationError>
Creates a validated diff line.
§Errors
Returns an error when the line kind, numbers, or text exceed the stable presentation bounds.
Sourcepub const fn kind(&self) -> CodeChangeLineKind
pub const fn kind(&self) -> CodeChangeLineKind
Returns the line kind.
Sourcepub const fn old_line(&self) -> Option<u32>
pub const fn old_line(&self) -> Option<u32>
Returns the one-based old-file line number when applicable.
Trait Implementations§
Source§impl Clone for CodeChangeLine
impl Clone for CodeChangeLine
Source§fn clone(&self) -> CodeChangeLine
fn clone(&self) -> CodeChangeLine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeChangeLine
impl Debug for CodeChangeLine
Source§impl<'de> Deserialize<'de> for CodeChangeLine
impl<'de> Deserialize<'de> for CodeChangeLine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CodeChangeLine
Source§impl Ord for CodeChangeLine
impl Ord for CodeChangeLine
Source§fn cmp(&self, other: &CodeChangeLine) -> Ordering
fn cmp(&self, other: &CodeChangeLine) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CodeChangeLine
impl PartialEq for CodeChangeLine
Source§impl PartialOrd for CodeChangeLine
impl PartialOrd for CodeChangeLine
Source§impl Serialize for CodeChangeLine
impl Serialize for CodeChangeLine
impl StructuralPartialEq for CodeChangeLine
Auto Trait Implementations§
impl Freeze for CodeChangeLine
impl RefUnwindSafe for CodeChangeLine
impl Send for CodeChangeLine
impl Sync for CodeChangeLine
impl Unpin for CodeChangeLine
impl UnsafeUnpin for CodeChangeLine
impl UnwindSafe for CodeChangeLine
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