Struct show_notes::e021::ThingToDestructure
source · pub struct ThingToDestructure {
pub a_field: String,
pub another: i32,
}
Expand description
A simple thing to demonstrate destructuring
let thing = ThingToDestructure {
a_field: "Neat!".into(),
another: 42,
};
let ThingToDestructure { a_field, another: can_rename } = thing;
println!("`a_field` is {} and another (`can_rename`) is {}", a_field, can_rename);
Fields§
§a_field: String
Just a field we can destructure.
another: i32
And another field we can destructure.
Auto Trait Implementations§
impl Freeze for ThingToDestructure
impl RefUnwindSafe for ThingToDestructure
impl Send for ThingToDestructure
impl Sync for ThingToDestructure
impl Unpin for ThingToDestructure
impl UnwindSafe for ThingToDestructure
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more