1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::expr::ReferenceType;
use crate::r#type::reference::Reference;
use crate::r#type::Type;

#[derive(Debug, Clone)]
pub struct ReferenceInfo {
    pub r#type: ReferenceType,
    pub reference: Reference,
    pub generics: Option<Vec<Type>>,
}

impl ReferenceInfo {

    pub fn new(r#type: ReferenceType, reference: Reference, generics: Option<Vec<Type>>) -> Self {
        Self { r#type, reference, generics }
    }

    pub fn r#type(&self) -> ReferenceType {
        self.r#type
    }

    pub fn reference(&self) -> &Reference {
        &self.reference
    }

    pub fn reference_path(&self) -> &Reference {
        &self.reference
    }

    pub fn generics(&self) -> Option<&Vec<Type>> {
        self.generics.as_ref()
    }
}