We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework cool example from the RfR book by
RfR
struct Grounded; struct Launched; // and so on struct Rocket<Stage = Grounded> { stage: std::marker::PhantomData<Stage>, } impl Default for Rocket<Grounded> {} impl Rocket<Grounded> { pub fn launch(self) -> Rocket<Launched> { } } impl Rocket<Launched> { pub fn accelerate(&mut self) { } pub fn decelerate(&mut self) { } } impl<Stage> Rocket<Stage> { pub fn color(&self) -> Color { } pub fn weight(&self) -> Kilograms { } }
Task 2: working up to the Mailbox assignment code. See also state type parameters.
Mailbox
Task 3: See the use of the typestate crate to avoid the boilerplate of the typestate pattern
typestate
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Rework cool example from the
RfR
book byTask 2: working up to the
Mailbox
assignment code.See also state type parameters.
Task 3: See the use of the
typestate
crate to avoid the boilerplate of the typestate patternThe text was updated successfully, but these errors were encountered: