hyperlit_model/location.rs
1use hyperlit_base::shared_string::SharedString;
2
3#[derive(Debug, Clone, Eq, Hash, PartialEq)]
4pub struct Location {
5 filepath: SharedString,
6 line: u32,
7}
8
9impl Location {
10 pub fn new(filepath: impl Into<SharedString>, line: u32) -> Location {
11 Location {
12 filepath: filepath.into(),
13 line,
14 }
15 }
16
17 pub fn filepath(&self) -> &str {
18 &self.filepath
19 }
20
21 pub fn line(&self) -> u32 {
22 self.line
23 }
24}