pub struct FindingLocation {
pub path: String,
pub line: Option<u32>,
pub column: Option<u32>,
}Expand description
Source location for a finding.
§Examples
use tokmd_envelope::FindingLocation;
// Path only
let loc = FindingLocation::path("src/main.rs");
assert_eq!(loc.path, "src/main.rs");
assert!(loc.line.is_none());
// Path + line
let loc = FindingLocation::path_line("src/lib.rs", 42);
assert_eq!(loc.line, Some(42));
// Path + line + column
let loc = FindingLocation::path_line_column("src/lib.rs", 42, 10);
assert_eq!(loc.column, Some(10));Fields§
§path: StringFile path (normalized to forward slashes).
line: Option<u32>Line number (1-indexed).
column: Option<u32>Column number (1-indexed).
Implementations§
Trait Implementations§
Source§impl Clone for FindingLocation
impl Clone for FindingLocation
Source§fn clone(&self) -> FindingLocation
fn clone(&self) -> FindingLocation
Returns a duplicate of the value. Read more
1.0.0 · 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 FindingLocation
impl Debug for FindingLocation
Source§impl<'de> Deserialize<'de> for FindingLocation
impl<'de> Deserialize<'de> for FindingLocation
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
Auto Trait Implementations§
impl Freeze for FindingLocation
impl RefUnwindSafe for FindingLocation
impl Send for FindingLocation
impl Sync for FindingLocation
impl Unpin for FindingLocation
impl UnsafeUnpin for FindingLocation
impl UnwindSafe for FindingLocation
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