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

Function file_source

packages/server/src/camera.rs:358–368  ·  view source on GitHub ↗
(path_or_url: &str)

Source from the content-addressed store, hash-verified

356}
357
358pub fn file_source(path_or_url: &str) -> CameraSource {
359 let kind = if is_video_source(path_or_url) {
360 CameraSourceKind::Video
361 } else {
362 CameraSourceKind::Image
363 };
364 CameraSource {
365 kind,
366 arg: Some(path_or_url.to_owned()),
367 }
368}
369
370fn is_url(value: &str) -> bool {
371 value.starts_with("http://") || value.starts_with("https://") || value.starts_with("file://")

Callers 1

camera_source_from_argsFunction · 0.85

Calls 1

is_video_sourceFunction · 0.85

Tested by

no test coverage detected