Skip to main content

ShardServiceClient

Struct ShardServiceClient 

Source
pub struct ShardServiceClient<Stub = Channel<ShardServiceRequest, ShardServiceResponse>>(/* private fields */);
Expand description

The client stub that makes RPC calls to the server. All request methods return Futures.

Implementations§

Source§

impl ShardServiceClient

Source

pub fn new<T>( config: Config, transport: T, ) -> NewClient<Self, RequestDispatch<ShardServiceRequest, ShardServiceResponse, T>>

Returns a new client stub that sends requests over the given transport.

Source§

impl<Stub> ShardServiceClient<Stub>
where Stub: Stub<Req = ShardServiceRequest, Resp = ShardServiceResponse>,

Source

pub fn ingest_document( &self, ctx: Context, doc: Document, ) -> impl Future<Output = Result<RpcResult<DocumentId>, RpcError>> + '_

Ingest a document into this shard.

The document will be processed by local agents during the next tick. Returns the document ID assigned to the ingested document.

Source

pub fn tick_phase( &self, ctx: Context, phase: TickPhase, tick: u64, ) -> impl Future<Output = Result<RpcResult<PhaseResult>, RpcError>> + '_

Execute a tick phase on this shard.

Phases are executed in order: Sense -> Act -> Decay -> Advance. Each phase must complete on all shards before the next phase begins (barrier sync).

Source

pub fn local_query( &self, ctx: Context, req: LocalQueryRequest, ) -> impl Future<Output = Result<RpcResult<LocalQueryResult>, RpcError>> + '_

Execute a local query (part of distributed query).

Returns matching nodes from this shard’s portion of the graph. Results are combined by the coordinator using scatter-gather.

Source

pub fn get_term_frequencies( &self, ctx: Context, terms: Vec<String>, ) -> impl Future<Output = Result<RpcResult<HashMap<String, u64>>, RpcError>> + '_

Get term frequencies for global DF computation.

Returns a map of term -> document frequency for TF-IDF calculation. Used during global DF aggregation for TF-IDF scoring.

Source

pub fn get_node( &self, ctx: Context, id: NodeId, ) -> impl Future<Output = Result<RpcResult<Option<NodeData>>, RpcError>> + '_

Fetch a node’s full data (for ghost node resolution).

Used when a shard needs detailed information about a node that exists on another shard.

Source

pub fn health_check( &self, ctx: Context, ) -> impl Future<Output = Result<RpcResult<ShardHealth>, RpcError>> + '_

Health check.

Returns the current health status of this shard including resource usage and processing statistics.

Source

pub fn resolve_ghost_nodes( &self, ctx: Context, node_ids: Vec<NodeId>, ) -> impl Future<Output = Result<RpcResult<Vec<GhostNode>>, RpcError>> + '_

Resolve cross-shard edges by fetching ghost node data.

Batch operation to fetch data for multiple nodes at once, creating ghost node representations for cross-shard edges.

Source

pub fn get_neighbors( &self, ctx: Context, node_id: NodeId, ) -> impl Future<Output = Result<RpcResult<Vec<NodeId>>, RpcError>> + '_

Get the list of nodes connected to a given node.

Returns node IDs of all neighbors, including cross-shard references.

Source

pub fn receive_signals( &self, ctx: Context, signals: Vec<CrossShardSignal>, ) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_

Receive cross-shard signals during the Exchange phase.

Signals from other shards are delivered here for local processing.

Trait Implementations§

Source§

impl<Stub: Clone> Clone for ShardServiceClient<Stub>

Source§

fn clone(&self) -> ShardServiceClient<Stub>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Stub: Debug> Debug for ShardServiceClient<Stub>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Stub> From<Stub> for ShardServiceClient<Stub>
where Stub: Stub<Req = ShardServiceRequest, Resp = ShardServiceResponse>,

Source§

fn from(stub: Stub) -> Self

Returns a new client stub that sends requests over the given transport.

Auto Trait Implementations§

§

impl<Stub> Freeze for ShardServiceClient<Stub>
where Stub: Freeze,

§

impl<Stub> RefUnwindSafe for ShardServiceClient<Stub>
where Stub: RefUnwindSafe,

§

impl<Stub> Send for ShardServiceClient<Stub>
where Stub: Send,

§

impl<Stub> Sync for ShardServiceClient<Stub>
where Stub: Sync,

§

impl<Stub> Unpin for ShardServiceClient<Stub>
where Stub: Unpin,

§

impl<Stub> UnsafeUnpin for ShardServiceClient<Stub>
where Stub: UnsafeUnpin,

§

impl<Stub> UnwindSafe for ShardServiceClient<Stub>
where Stub: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more