Improving our example 2-references 223 let writer = &mut buffer; println!("Program starting"); let txt = http::Http::get("/600/Hello Async Await"). wait; writeln!(writer, "{txt}"). unwrap(); let txt = http::Http::get("/400/Hello Async Await"). wait; writeln!(writer, "{txt}"). unwrap(); println!( "{}", buffer); } So, in this example, we create a buffer variable of the String type that we initialize with some text, and we take a &mut reference to that and store it in a writer variable. Every time we receive a response, we write the response to the buffer through the &mut reference we hold in writer before we print the buffer to the terminal at the end of the program. Let's take a look at what we need to do to get this working. The first thing we do is pull in the fmt::Write trait so that we can write to our buffer using the writeln! macro. Add this to the top of main. rs : ch09/b-coroutines-references/src/main. rs use std::fmt::Write; Next, we need to change our Stack0 struct so that it represents what we must store across wait points in our updated example: ch09/b-coroutines-references/src/main. rs #[derive(Default)] struct Stack0 { buffer: Option<String>, writer: Option<*mut String>, } An important thing to note here is that writer can't be Option<&mut String> since we know it will be referencing the buffer field in the same struct. A struct where a field takes a reference on &self is called a self-referential struct and there is no way to represent that in Rust since the lifetime of the self-reference is impossible to express. The solution is to cast the &mut self-reference to a pointer instead and ensure that we manage the lifetimes correctly ourselves.