Client RPCs
ScoutClient methods that call database RPCs
Database RPC methods
RPCs connect lazily. Device clients normally call identify() first;
service-role clients do not need to.
Gallery
get_gallery_by_device and get_gallery_by_herd return a lean, keyset-paginated
GalleryPage. Limits are validated and has_more requires an over-fetched row.
get_gallery_items_by_ids hydrates positive event and artifact IDs in one RPC,
deduplicates them, and preserves an optional mixed ranked_ids order.
classify_media and GalleryItem::media_kind() classify supported image,
video, and audio extensions, including .m4v, before stored metadata. Gallery
items expose paths for authenticated StorageClient reads, not signed URLs.
Connectivity
get_connectivity_for_artifact(artifact_id, max_elements?)
Fetches connectivity records for an artifact with a configurable limit.
- artifact_id (
i64): Artifact ID. - max_elements (
Option<i32>): Max records to return (default 1000). - Returns:
Result<ResponseScout<Vec<ConnectivityWithCoordinates>>, Error>
Uses the artifact’s session_id when set (efficient path); otherwise uses the artifact’s device and time window (timestamp_observation / timestamp_observation_end).
get_connectivity_with_coordinates(session_id)
Fetches connectivity records for a session (table query, ordered by timestamp_start).
Sessions and artifacts
get_artifact_ids_for_session(session_id)
Returns artifact IDs for a session: rows with session_id equal to this session, plus rows that still have session_id null but match the same device and overlapping session interval (fallback until backfill links them).
- session_id (
i64): Session ID. - Returns:
Result<ResponseScout<Vec<i64>>, Error>
Returns an empty array if the session is missing or timestamp_start / timestamp_end is null.
Tags
get_tags_for_artifact(artifact_id, start_timestamp?, end_timestamp?, max_elements?)
Fetches tags for an artifact with optional filters.
- artifact_id (
i64): Artifact ID. - start_timestamp (
Option<&str>): Only tags withtimestamp_observation >= start. - end_timestamp (
Option<&str>): Only tags withtimestamp_observation <= end. - max_elements (
Option<i32>): Max tags to return (default 1000). - Returns:
Result<ResponseScout<Vec<TagPrettyLocation>>, Error>
Results are ordered by timestamp_observation, then frame_index, then id.
Response types
- ConnectivityWithCoordinates: Connectivity row plus
latitudeandlongitude(from the RPC composite type). - TagPrettyLocation: Tag fields plus
origin_latitude,origin_longitude,subject_latitude,subject_longitudeand other RPC-only fields.