You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible like this? let records: Vec<CustomStruct> = vec![CustomStruct{type:"hello".to_string(), name: "world".to_string()}]; let data = ByteRecord::from(records);
However, the error msg is the trait bound csv::ByteRecord: From<&CustomStruct>is not satisfied the following other types implement traitFrom: <csv::ByteRecord as From<&'a [T]>> <csv::ByteRecord as From<StringRecord>> <csv::ByteRecord as From<Vec<T>>>
Please kindly advice.
The text was updated successfully, but these errors were encountered:
The version I'm using is
csv = "1.1.7"
.I try to initiate the ByteRecord with Vec.
#[derive(Debug, Serialize, Deserialize)] pub struct CustomStruct { pub type: String, pub name: String, }
Is it possible like this?
let records: Vec<CustomStruct> = vec![CustomStruct{type:"hello".to_string(), name: "world".to_string()}];
let data = ByteRecord::from(records);
However, the error msg is
the trait bound
csv::ByteRecord: From<&CustomStruct>is not satisfied the following other types implement trait
From: <csv::ByteRecord as From<&'a [T]>> <csv::ByteRecord as From<StringRecord>> <csv::ByteRecord as From<Vec<T>>>
Please kindly advice.
The text was updated successfully, but these errors were encountered: