MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / discovery_from_state

Method discovery_from_state

packages/server/src/webkit.rs:166–196  ·  view source on GitHub ↗
(
        &self,
        state: WebKitDiscoveryState,
        http_origin: Option<&str>,
    )

Source from the content-addressed store, hash-verified

164 }
165
166 fn discovery_from_state(
167 &self,
168 state: WebKitDiscoveryState,
169 http_origin: Option<&str>,
170 ) -> WebKitTargetDiscovery {
171 let origin = http_origin.unwrap_or("");
172 let mut targets = state
173 .pages
174 .into_values()
175 .filter(|page| !is_incomplete_or_transient_page(page))
176 .map(|page| {
177 let app = state.applications.get(&page.app_id);
178 webkit_target(&self.udid, origin, page, app)
179 })
180 .collect::<Vec<_>>();
181 targets.retain(is_inspectable_webkit_target);
182 targets.sort_by(|lhs, rhs| {
183 lhs.app_name
184 .cmp(&rhs.app_name)
185 .then(lhs.title.cmp(&rhs.title))
186 .then(lhs.url.cmp(&rhs.url))
187 .then(lhs.page_id.cmp(&rhs.page_id))
188 });
189
190 WebKitTargetDiscovery {
191 udid: self.udid.clone(),
192 socket_path: state.socket_path,
193 targets,
194 warnings: state.warnings,
195 }
196 }
197
198 async fn run(self: Arc<Self>) {
199 loop {

Callers 1

discoveryMethod · 0.80

Calls 4

webkit_targetFunction · 0.85
getMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected