Lines Matching refs:wtr

115     pub fn from_writer<W: io::Write>(&self, wtr: W) -> Writer<W> {  in from_writer()
116 Writer::new(self, wtr) in from_writer()
510 wtr: Option<W>, field
563 if self.wtr.is_some() && !self.state.panicked { in drop()
597 fn new(builder: &WriterBuilder, wtr: W) -> Writer<W> { in new()
605 wtr: Some(wtr), in new()
640 pub fn from_writer(wtr: W) -> Writer<W> { in from_writer()
641 WriterBuilder::new().from_writer(wtr) in from_writer()
1059 self.wtr.as_mut().unwrap().flush()?; in flush()
1067 let result = self.wtr.as_mut().unwrap().write_all(self.buf.readable()); in flush_buf()
1080 Ok(()) => Ok(self.wtr.take().unwrap()), in into_inner()
1197 fn wtr_as_string(wtr: Writer<Vec<u8>>) -> String { in wtr_as_string()
1198 String::from_utf8(wtr.into_inner().unwrap()).unwrap() in wtr_as_string()
1203 let mut wtr = WriterBuilder::new().from_writer(vec![]); in one_record() localVariable
1204 wtr.write_record(&["a", "b", "c"]).unwrap(); in one_record()
1206 assert_eq!(wtr_as_string(wtr), "a,b,c\n"); in one_record()
1211 let mut wtr = WriterBuilder::new().from_writer(vec![]); in one_string_record() localVariable
1212 wtr.write_record(&StringRecord::from(vec!["a", "b", "c"])).unwrap(); in one_string_record()
1214 assert_eq!(wtr_as_string(wtr), "a,b,c\n"); in one_string_record()
1219 let mut wtr = WriterBuilder::new().from_writer(vec![]); in one_byte_record() localVariable
1220 wtr.write_record(&ByteRecord::from(vec!["a", "b", "c"])).unwrap(); in one_byte_record()
1222 assert_eq!(wtr_as_string(wtr), "a,b,c\n"); in one_byte_record()
1227 let mut wtr = WriterBuilder::new().from_writer(vec![]); in raw_one_byte_record() localVariable
1228 wtr.write_byte_record(&ByteRecord::from(vec!["a", "b", "c"])).unwrap(); in raw_one_byte_record()
1230 assert_eq!(wtr_as_string(wtr), "a,b,c\n"); in raw_one_byte_record()
1235 let mut wtr = WriterBuilder::new().from_writer(vec![]); in one_empty_record() localVariable
1236 wtr.write_record(&[""]).unwrap(); in one_empty_record()
1238 assert_eq!(wtr_as_string(wtr), "\"\"\n"); in one_empty_record()
1243 let mut wtr = WriterBuilder::new().from_writer(vec![]); in raw_one_empty_record() localVariable
1244 wtr.write_byte_record(&ByteRecord::from(vec![""])).unwrap(); in raw_one_empty_record()
1246 assert_eq!(wtr_as_string(wtr), "\"\"\n"); in raw_one_empty_record()
1251 let mut wtr = WriterBuilder::new().from_writer(vec![]); in two_empty_records() localVariable
1252 wtr.write_record(&[""]).unwrap(); in two_empty_records()
1253 wtr.write_record(&[""]).unwrap(); in two_empty_records()
1255 assert_eq!(wtr_as_string(wtr), "\"\"\n\"\"\n"); in two_empty_records()
1260 let mut wtr = WriterBuilder::new().from_writer(vec![]); in raw_two_empty_records() localVariable
1261 wtr.write_byte_record(&ByteRecord::from(vec![""])).unwrap(); in raw_two_empty_records()
1262 wtr.write_byte_record(&ByteRecord::from(vec![""])).unwrap(); in raw_two_empty_records()
1264 assert_eq!(wtr_as_string(wtr), "\"\"\n\"\"\n"); in raw_two_empty_records()
1269 let mut wtr = WriterBuilder::new().from_writer(vec![]); in unequal_records_bad() localVariable
1270 wtr.write_record(&ByteRecord::from(vec!["a", "b", "c"])).unwrap(); in unequal_records_bad()
1271 let err = wtr.write_record(&ByteRecord::from(vec!["a"])).unwrap_err(); in unequal_records_bad()
1286 let mut wtr = WriterBuilder::new().from_writer(vec![]); in raw_unequal_records_bad() localVariable
1287 wtr.write_byte_record(&ByteRecord::from(vec!["a", "b", "c"])).unwrap(); in raw_unequal_records_bad()
1289 wtr.write_byte_record(&ByteRecord::from(vec!["a"])).unwrap_err(); in raw_unequal_records_bad()
1304 let mut wtr = WriterBuilder::new().flexible(true).from_writer(vec![]); in unequal_records_ok() localVariable
1305 wtr.write_record(&ByteRecord::from(vec!["a", "b", "c"])).unwrap(); in unequal_records_ok()
1306 wtr.write_record(&ByteRecord::from(vec!["a"])).unwrap(); in unequal_records_ok()
1307 assert_eq!(wtr_as_string(wtr), "a,b,c\na\n"); in unequal_records_ok()
1312 let mut wtr = WriterBuilder::new().flexible(true).from_writer(vec![]); in raw_unequal_records_ok() localVariable
1313 wtr.write_byte_record(&ByteRecord::from(vec!["a", "b", "c"])).unwrap(); in raw_unequal_records_ok()
1314 wtr.write_byte_record(&ByteRecord::from(vec!["a"])).unwrap(); in raw_unequal_records_ok()
1315 assert_eq!(wtr_as_string(wtr), "a,b,c\na\n"); in raw_unequal_records_ok()
1344 let mut wtr = in full_buffer_should_not_flush_underlying() localVariable
1347 wtr.write_byte_record(&ByteRecord::from(vec!["a", "b"])).unwrap(); in full_buffer_should_not_flush_underlying()
1348 wtr.write_byte_record(&ByteRecord::from(vec!["c", "d"])).unwrap(); in full_buffer_should_not_flush_underlying()
1349 wtr.flush().unwrap(); in full_buffer_should_not_flush_underlying()
1350 wtr.write_byte_record(&ByteRecord::from(vec!["e", "f"])).unwrap(); in full_buffer_should_not_flush_underlying()
1352 let got = wtr.into_inner().unwrap().to_str(); in full_buffer_should_not_flush_underlying()
1368 let mut wtr = WriterBuilder::new().from_writer(vec![]); in serialize_with_headers() localVariable
1369 wtr.serialize(Row { foo: 42, bar: 42.5, baz: true }).unwrap(); in serialize_with_headers()
1370 assert_eq!(wtr_as_string(wtr), "foo,bar,baz\n42,42.5,true\n"); in serialize_with_headers()
1382 let mut wtr = in serialize_no_headers() localVariable
1384 wtr.serialize(Row { foo: 42, bar: 42.5, baz: true }).unwrap(); in serialize_no_headers()
1385 assert_eq!(wtr_as_string(wtr), "42,42.5,true\n"); in serialize_no_headers()
1398 let mut wtr = localVariable
1400 wtr.serialize(Row {
1405 assert_eq!(wtr_as_string(wtr), "9223372036854775808,42.5,true\n");
1411 let mut wtr = WriterBuilder::new().from_writer(vec![]); in serialize_tuple() localVariable
1412 wtr.serialize((true, 1.3, "hi")).unwrap(); in serialize_tuple()
1413 assert_eq!(wtr_as_string(wtr), "true,1.3,hi\n"); in serialize_tuple()