blob: 121ad252af945826f514690ac15ed460f8cbf0b6 (
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.clone()
}
fn get_date_of_birth(&self) -> &'static str
{
self.date_of_birth.clone()
}
fn get_password(&self) -> &'static str
{
self.password.clone()
}
}
|