..
as a field in a struct
or tuple pattern means “and the rest”:
let ThreeDPoint { x: my_x, y: my_y, .. } = point;
There’s more about this in the Rust Book.
Related Contents:
- Why can’t I store a value and a reference to that value in the same struct?
- How do I create a global, mutable singleton?
- How can a Rust program access metadata from its Cargo package?
- Cargo build hangs with ” Blocking waiting for file lock on the registry index” after building parity from source
- Is there a faster/shorter way to initialize variables in a Rust struct?
- How to convert a String into a &’static str
- What are the identifiers denoted with a single apostrophe (‘)?
- No default toolchain configured after installing rustup
- Is there a command to update Cargo to the latest official release?
- How to sort a vector in Rust?
- How to print structs and arrays?
- How can I list files of a directory in Rust?
- How does one round a floating point number to a specified number of digits?
- Is there a good way to convert a Vec to an array?
- How to remove an element from a vector given the element?
- Does println! borrow or own the variable?
- What is this unwrap thing: sometimes it’s unwrap sometimes it’s unwrap_or
- How do I implement a trait I don’t own for a type I don’t own?
- What is a clean way to convert a Result into an Option?
- How to create an in-memory object that can be used as a Reader, Writer, or Seek in Rust?
- How to suppress “function is never used” warning for a function used by tests?
- How do I collect into an array?
- How is Rust compiled to machine code?
- How can I read a single line from stdin?
- Why is using return as the last statement in a function considered bad style?
- I implemented a trait for another trait but cannot call methods from both traits
- How do I synchronously return a value calculated in an asynchronous Future?
- What is the correct way to use lifetimes with a struct in Rust?
- How do I assert an enum is a specific variant if I don’t care about its fields?
- Sending trait objects between threads in Rust
- Check if a string is empty or blank
- How do I specify lifetime parameters in an associated type?
- Why is Rust’s assert_eq! implemented using a match?
- Is there a way to combine multiple traits in order to define a new trait? [duplicate]
- Why does iteration over an inclusive range generate longer assembly in Rust than in C++?
- Rust proper error handling (auto convert from one error type to another with question mark)
- What is a “fundamental type” in Rust?
- What is the syntax to match on a reference to an enum?
- Can I mark a function as deprecated?
- How do I ignore an error returned from a Rust function and proceed regardless?
- How do I use std::num::sqrt to compute the square root of a number?
- What is &’a in Rust Language [duplicate]
- What are the differences between an impl trait argument and generic function parameter?
- Creating a static const Vec [duplicate]
- Is there a more concise way to format .expect() message?
- Why rust is failing to build command for openssl-sys v0.9.60 even after local installation?
- Tuple struct constructor complains about private fields
- How to count the elements in a vector with some value without looping?
- What are some use cases for tuple structs?
- How to restrict the construction of struct?