pub struct Service { /* private fields */ }Expand description
Wraps a Store (records) and a BlobStore (content-addressed slices) and
exposes their operations to the daemon transports. The daemon backs both
with the same FsStore.
Implementations§
Source§impl Service
impl Service
pub fn new(store: Arc<dyn Store>, blobs: Arc<dyn BlobStore>) -> Self
Sourcepub fn with_max_blob_size(self, n: usize) -> Self
pub fn with_max_blob_size(self, n: usize) -> Self
Override the per-blob size ceiling (bytes) used by the HTTP body limit and the gRPC decode limit.
Sourcepub fn max_blob_size(&self) -> usize
pub fn max_blob_size(&self) -> usize
The per-blob size ceiling (bytes).
pub async fn get_blob(&self, hash: &ContentHash) -> Result<Option<Vec<u8>>>
pub async fn put_blob(&self, content: &[u8]) -> Result<ContentHash>
pub async fn list_blobs(&self) -> Result<Vec<ContentHash>>
pub async fn delete_blob(&self, hash: &ContentHash) -> Result<()>
Sourcepub fn with_graph_root(self, graph_root: impl Into<PathBuf>) -> Self
pub fn with_graph_root(self, graph_root: impl Into<PathBuf>) -> Self
Serve code-graph queries from persistent SQLite graphs rooted at
graph_root (matching gonzalo index’s <store_root>/graphs), falling
back to slice assembly for views without an indexed db.
pub async fn get(&self, key: &RecordKey) -> Result<Option<Record>>
Sourcepub async fn ready(&self) -> bool
pub async fn ready(&self) -> bool
Readiness probe: whether the backing store is reachable. Does a cheap
point lookup of a sentinel key — Ok (even Ok(None)) means the store
answered, Err means it is unreachable (bad endpoint/bucket, down
backend), so a load balancer should route around this replica. Backs
GET /readyz; liveness (/healthz) needs no store access.
pub async fn put( &self, record: Record, expected: Option<Revision>, ) -> Result<PutResult>
pub async fn list(&self, prefix: &KeyPrefix) -> Result<Vec<RecordKey>>
pub async fn delete( &self, key: &RecordKey, expected: Option<Revision>, ) -> Result<DeleteResult>
Sourcepub async fn ticket_sync(
&self,
conn: &Connection,
author: &str,
) -> Result<IngestSummary, TicketSyncError>
pub async fn ticket_sync( &self, conn: &Connection, author: &str, ) -> Result<IngestSummary, TicketSyncError>
Build a source for conn from the registry and ingest its tickets into
the backing store. The error is typed so each transport can return the
right status: a misconfigured request is a client error, a
build/ingest failure is a server error.
Sourcepub async fn view_exists(&self, repo: &str, view_id: &str) -> Result<bool>
pub async fn view_exists(&self, repo: &str, view_id: &str) -> Result<bool>
Whether (repo, view_id) names a view that exists — a persistent graph
under graph_root, or a manifest record in the store.
Sourcepub async fn graph_views(&self) -> Result<Vec<ViewSummary>>
pub async fn graph_views(&self) -> Result<Vec<ViewSummary>>
Every indexed view, for discovery. Cheap by design — this is the call an
agent makes first, so it reads manifests (and the recorded base commit)
rather than loading each view’s graph. Use overview for symbol counts.
Sourcepub async fn graph_definitions(
&self,
repo: &str,
view_id: &str,
name: &str,
) -> Result<Vec<Located<Symbol>>>
pub async fn graph_definitions( &self, repo: &str, view_id: &str, name: &str, ) -> Result<Vec<Located<Symbol>>>
Definitions of name in the view, each with its path.
Sourcepub async fn graph_references_to(
&self,
repo: &str,
view_id: &str,
name: &str,
) -> Result<Vec<Located<Reference>>>
pub async fn graph_references_to( &self, repo: &str, view_id: &str, name: &str, ) -> Result<Vec<Located<Reference>>>
References to name in the view, each with its path.
Sourcepub async fn graph_callers_of(
&self,
repo: &str,
view_id: &str,
name: &str,
) -> Result<Vec<String>>
pub async fn graph_callers_of( &self, repo: &str, view_id: &str, name: &str, ) -> Result<Vec<String>>
Enclosing functions that call name in the view.
Sourcepub async fn graph_callees(
&self,
repo: &str,
view_id: &str,
name: &str,
) -> Result<Vec<String>>
pub async fn graph_callees( &self, repo: &str, view_id: &str, name: &str, ) -> Result<Vec<String>>
Names called from within name in the view.
Sourcepub async fn graph_impact(
&self,
repo: &str,
view_id: &str,
name: &str,
max_depth: Option<usize>,
) -> Result<ImpactReport>
pub async fn graph_impact( &self, repo: &str, view_id: &str, name: &str, max_depth: Option<usize>, ) -> Result<ImpactReport>
Transitive caller closure of name (impact of changing it).
Symbols transitively affected if name changes, following only call
edges that resolve to a specific definition.
Uses resolved_impact rather than the name-matched
GraphStore::impact, which merged unrelated subgraphs through shared
identifiers (#207). Edges that cannot be attributed are counted in the
report instead of being traversed or silently dropped.
Sourcepub async fn graph_impact_names(
&self,
repo: &str,
view_id: &str,
name: &str,
) -> Result<Vec<String>>
pub async fn graph_impact_names( &self, repo: &str, view_id: &str, name: &str, ) -> Result<Vec<String>>
graph_impact flattened to distinct caller names.
The daemon transports speak a shared name-list shape for callers_of,
callees and impact, so they take this projection. They still get the
resolution-gated walk — only the ambiguous_edges and per-node paths are
dropped, which is why the MCP surface returns the full report.
Sourcepub async fn graph_overview(
&self,
repo: &str,
view_id: &str,
largest: usize,
) -> Result<ViewOverview>
pub async fn graph_overview( &self, repo: &str, view_id: &str, largest: usize, ) -> Result<ViewOverview>
Aggregate shape of the view: counts, breakdowns by kind and language,
and the largest files by symbol count.
Sourcepub async fn graph_top(
&self,
repo: &str,
view_id: &str,
ranking: Ranking,
limit: usize,
) -> Result<Page<RankedSymbol>>
pub async fn graph_top( &self, repo: &str, view_id: &str, ranking: Ranking, limit: usize, ) -> Result<Page<RankedSymbol>>
Top limit symbol names in the view by ranking.
Sourcepub async fn graph_list(
&self,
repo: &str,
view_id: &str,
filter: &SymbolFilter,
limit: usize,
) -> Result<Page<Located<Symbol>>>
pub async fn graph_list( &self, repo: &str, view_id: &str, filter: &SymbolFilter, limit: usize, ) -> Result<Page<Located<Symbol>>>
Symbols in the view matching filter, bounded by limit.
Sourcepub async fn graph_unreferenced(
&self,
repo: &str,
view_id: &str,
filter: &SymbolFilter,
exclude_tests: bool,
limit: usize,
) -> Result<Page<Located<Symbol>>>
pub async fn graph_unreferenced( &self, repo: &str, view_id: &str, filter: &SymbolFilter, exclude_tests: bool, limit: usize, ) -> Result<Page<Located<Symbol>>>
Dead-code candidates in the view: symbols with no inbound reference,
heuristic — see GraphStore::unreferenced for the blind spots.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Service
impl !RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl UnsafeUnpin for Service
impl !UnwindSafe for Service
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request