MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / iter

Method iter

crates/client-api/src/util/flat_csv.rs:60–83  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

58
59impl<Sep: Separator> FlatCsv<Sep> {
60 pub(crate) fn iter(&self) -> impl Iterator<Item = &str> {
61 self.value.to_str().ok().into_iter().flat_map(|value_str| {
62 let mut in_quotes = false;
63 value_str
64 .split(move |c| {
65 if in_quotes {
66 if c == '"' {
67 in_quotes = false;
68 }
69 false // dont split
70 } else {
71 if c == Sep::CHAR {
72 true // split
73 } else {
74 if c == '"' {
75 in_quotes = true;
76 }
77 false // dont split
78 }
79 }
80 })
81 .map(|item| item.trim())
82 })
83 }
84}
85
86impl<Sep> From<HeaderValue> for FlatCsv<Sep> {

Callers

nothing calls this directly

Calls 4

splitMethod · 0.80
into_iterMethod · 0.45
okMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected