A compact index of the public surface, grouped by the crate’s four layers. Import hooks and common types from the crate root; import layer-specific items from gpui_query::core, gpui_query::client, or gpui_query::hook. Persistence types live under gpui_query::client behind the persist feature.
The core layer has no GPUI dependency. The data-carrying types are Serialize + Deserialize and safe to persist: QueryKey, CachePolicy, RequestPolicy, RetryPolicy, QueryStatus, MutationStatus, RequestId, RequestSequencer, QueryError, QueryErrorKind, QueryResource, MutationResource, InfiniteQueryResource, FetchDirection, NetworkMode, RefetchTrigger, and QueryTimestamp (QueryKey and QueryError via manual impls). QueryKeyFilter, QueryFetchMode, QueryBeginResult, QuerySignal, SelectTransform, MappedQueryResource, Fetched, and RequestGuard are runtime-only and not serde.
Default error type. Display + Error, Arc<str> message. Constructors: new / response / transport / cancelled / unknown; sanitized() is a &self method returning a copy with the message redacted.
Drop-guard from persist_with (drop stops new saves) / no-op backend for tests.
SerializerRegistry (persist)
struct
Typed T -> serde_json::Value registry driving snapshot collection. Register serializers and deserializers via QueryClient::register_serializer / register_deserializer.
PersistError / PERSIST_VERSION (persist)
enum / const
Io / Serialize / Deserialize / VersionMismatch / BadPath / Permission; snapshot format version (2, bumped in 0.3.0 when QueryKey::to_path escaping made key paths injective). Snapshots stamped with any other version fail to load with VersionMismatch.
The subscription-bearing hooks (use_query and its variants, use_infinite_query, use_mutation) return (Entity<Resource>, Subscription); use_query_select returns a triple. Store both. use_mutation_state instead returns Vec<Entity<MutationResource<V,T,E>>>, and the imperative fetch_* / mutate* helpers return ().
Item
Returns
Notes
use_query
(Entity<QueryResource<T,E>>, Subscription)
Primary query hook, signal-always.
use_query_manual / _opts
same
Lower-level: explicit params.
use_query_unsignalled / _opts
same
Fetcher takes no signal (legacy).
use_query_with_policy
same
Like use_query, but the fetcher returns Fetched<T>, so a server-derived CachePolicy overrides the stored one on success.