Check out example codes for "append to file rust". It will help you in understanding the concepts better.

Code Example 1

// don't forget importing this
use std::io::Write;

let mut file = fs::OpenOptions::new()
      .write(true)
      .append(true)
      .open("file.txt")
      .unwrap();
      
file.write_all(b"to append");
// or
write!(file, "to append");

Learn ReactJs, React Native from akashmittal.com