use std::io;
      
      fn main() -> Result<()> {
        let mut wtr = csv::Writer::from_writer(io::stdout());
        wtr.write_record(&["Name", "Place", "ID"])?;
        wtr.serialize(("Mark", "Sydney", 87))?;
        wtr.serialize(("Ashley", "Dublin", 32))?;
        wtr.serialize(("Akshat", "Delhi", 11))?;
        wtr.flush()?;
        Ok(())
      }
      
      Rust language logo

      Serialize csv records

      Codiga's Rust Recipes

      serialize a tuple

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.