pub fn from_slice_borrowed<'input, 'facet, T>(
input: &'input [u8],
) -> Result<T, DeserializeError<CsvError>>where
T: Facet<'facet>,
'input: 'facet,Expand description
Deserialize a value from CSV bytes, allowing zero-copy borrowing.
§Errors
Returns an error if the input is not valid UTF-8 or if deserialization fails.
§Example
use facet::Facet;
use facet_csv::from_slice_borrowed;
#[derive(Facet, Debug, PartialEq)]
struct Person {
name: String,
age: u32,
}
let csv = b"Alice,30";
let person: Person = from_slice_borrowed(csv).unwrap();
assert_eq!(person.name, "Alice");
assert_eq!(person.age, 30);