// private fields omitted?
Beyond just construction, it also effects unsafe manipulations like transmute, as well as destructuring:
mod foo {
pub struct Baz{
a: uint,
pub b: uint,
}
pub fn make_baz() -> Baz{
Baz { a: 0, b: 1 }
}
}
mod bar {
use foo;
fn main () {
let baz = foo::make_baz();
//must omit a value, because there's more, but we can't reference them
let foo::Baz { b, .. } = baz;
println!("{}", b);
}
}