aboutsummaryrefslogtreecommitdiff
path: root/examples/factory/user.rs
blob: 97a7632768bb4b2e38769df9354b19ae7de89168 (plain)
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
34
35
36
37
38
39
40
41
42
use crate::interfaces::user::IUser;

pub struct User
{
    name: &'static str,
    date_of_birth: &'static str,
    password: &'static str,
}

impl User
{
    pub fn new(
        name: &'static str,
        date_of_birth: &'static str,
        password: &'static str,
    ) -> Self
    {
        Self {
            name,
            date_of_birth,
            password,
        }
    }
}

impl IUser for User
{
    fn get_name(&self) -> &'static str
    {
        self.name
    }

    fn get_date_of_birth(&self) -> &'static str
    {
        self.date_of_birth
    }

    fn get_password(&self) -> &'static str
    {
        self.password
    }
}