2023-06-21 16:08:37 +02:00
|
|
|
pub struct User {
|
2022-12-21 17:36:30 +02:00
|
|
|
name: String,
|
|
|
|
age: u32,
|
2023-07-12 00:01:49 +02:00
|
|
|
height: f32,
|
|
|
|
visit_count: usize,
|
|
|
|
last_blood_pressure: Option<(u32, u32)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Measurements {
|
|
|
|
height: f32,
|
|
|
|
blood_pressure: (u32, u32),
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct HealthReport<'a> {
|
|
|
|
patient_name: &'a str,
|
|
|
|
visit_count: u32,
|
|
|
|
height_change: f32,
|
|
|
|
blood_pressure_change: Option<(i32, i32)>,
|
2022-12-21 17:36:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
impl User {
|
2023-07-12 00:01:49 +02:00
|
|
|
pub fn new(name: String, age: u32, height: f32) -> Self {
|
2022-12-21 17:36:30 +02:00
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn name(&self) -> &str {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn age(&self) -> u32 {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
2023-07-12 00:01:49 +02:00
|
|
|
pub fn height(&self) -> f32 {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn doctor_visits(&self) -> u32 {
|
2022-12-21 17:36:30 +02:00
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_age(&mut self, new_age: u32) {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
2023-07-12 00:01:49 +02:00
|
|
|
pub fn set_height(&mut self, new_height: f32) {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn visit_doctor(&mut self, measurements: Measurements) -> HealthReport {
|
2022-12-21 17:36:30 +02:00
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|