1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-18 12:30:31 +02:00
comprehensive-rust/third_party/rust-on-exercism/health-statistics.rs

54 lines
1019 B
Rust
Raw Normal View History

pub struct User {
2022-12-21 17:36:30 +02:00
name: String,
age: u32,
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 {
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!()
}
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!()
}
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!()
}
}