MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from_query_value

Method from_query_value

atomic-remote/src/streaming/layers.rs:131–143  ·  view source on GitHub ↗

Parse from a query parameter value. Accepts: - `"all"` → all layers - `"graph,content"` → graph + content - `"semantic,content"` → semantic + content - `"graph"` → graph only - Any comma-separated combination of layer names Unknown layer names are silently ignored. # Examples ```rust use atomic_remote::streaming::{LayerSelection, Layer}; let sel = LayerSelection::from_query_value("graph,conte

(value: &str)

Source from the content-addressed store, hash-verified

129 /// assert!(sel.includes(Layer::Content));
130 /// ```
131 pub fn from_query_value(value: &str) -> Self {
132 let trimmed = value.trim();
133 if trimmed.eq_ignore_ascii_case("all") {
134 return Self::all();
135 }
136
137 let layers: HashSet<Layer> = trimmed
138 .split(',')
139 .filter_map(|s| Layer::from_str_loose(s.trim()))
140 .collect();
141
142 Self { layers }
143 }
144
145 /// Serialize to a query parameter value.
146 ///

Callers

nothing calls this directly

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected