pub struct RegistryClient { /* private fields */ }Expand description
Registry client for collective intelligence data.
In offline mode, all queries return empty results and publish operations are silently dropped. In online mode (not yet implemented), the client would communicate with a remote registry server.
Implementations§
Source§impl RegistryClient
impl RegistryClient
Sourcepub fn online(endpoint: String) -> Self
pub fn online(endpoint: String) -> Self
Create a new registry client in online mode (stub).
Note: Online mode is not yet implemented. The client will still behave as offline but will store the endpoint for future use.
Sourcepub fn mode(&self) -> &RegistryMode
pub fn mode(&self) -> &RegistryMode
Get the current operating mode.
Sourcepub fn query_patterns(
&mut self,
language: &str,
category: &str,
) -> Vec<UsagePattern>
pub fn query_patterns( &mut self, language: &str, category: &str, ) -> Vec<UsagePattern>
Query patterns from the registry.
In offline mode, always returns an empty list. Checks cache first before making any (future) network calls.
Sourcepub fn publish_delta(&mut self, _delta: &CollectiveDelta) -> bool
pub fn publish_delta(&mut self, _delta: &CollectiveDelta) -> bool
Publish a delta to the registry.
In offline mode, the delta is silently dropped. Returns true if the delta was accepted (or dropped in offline mode).
Sourcepub fn cache(&self) -> &CollectiveCache
pub fn cache(&self) -> &CollectiveCache
Access the internal cache.
Sourcepub fn cache_mut(&mut self) -> &mut CollectiveCache
pub fn cache_mut(&mut self) -> &mut CollectiveCache
Access the internal cache mutably.
Sourcepub fn maybe_run_cache_maintenance(&mut self)
pub fn maybe_run_cache_maintenance(&mut self)
Run cache maintenance if the maintenance interval has elapsed.