in pyo3_special_method_derive_example/src/lib.rs [192:211]
fn get_full_address(&self) -> String {
match self {
PyAddress::House {
country,
city,
street,
street_number,
} => {
let city_lock = city.city.read().unwrap(); // Properly handle potential errors in real code
format!(
"{}, {}, {}-{}",
country,
city_lock.name, // Accessing the name field of PyCity
street,
street_number
)
}
}
}