Skip to main content

mq_hir/
source.rs

1use url::Url;
2
3slotmap::new_key_type! { pub struct SourceId; }
4
5#[derive(Debug, Clone, PartialEq, Eq, Hash)]
6pub struct Source {
7    pub url: Option<Url>,
8}
9
10impl Source {
11    pub fn new(url: Option<Url>) -> Self {
12        Self { url }
13    }
14}
15
16#[derive(Debug, Clone, PartialEq)]
17pub struct SourceInfo {
18    pub source_id: Option<SourceId>,
19    pub text_range: Option<mq_lang::Range>,
20}
21
22impl SourceInfo {
23    pub fn new(source_id: Option<SourceId>, text_range: Option<mq_lang::Range>) -> Self {
24        Self { source_id, text_range }
25    }
26}