Skip to main content

FoldQueryClient

Struct FoldQueryClient 

Source
pub struct FoldQueryClient { /* private fields */ }
Expand description

Typed fold.query client. Cheap to clone (just clones the Arcs); operator tooling typically constructs one per process and shares it.

Implementations§

Source§

impl FoldQueryClient

Source

pub fn new(mesh: Arc<MeshNode>) -> Self

Build a client backed by mesh with the default TTL + deadline. Callers wanting non-defaults use Self::with_ttl / Self::with_deadline.

Source

pub fn with_ttl(self, ttl: Duration) -> Self

Override the cache TTL. Duration::ZERO disables the cache entirely (every call hits the wire).

Source

pub fn with_deadline(self, deadline: Duration) -> Self

Override the per-call deadline.

Source

pub fn set_ttl_mut(&mut self, ttl: Duration)

Override the cache TTL in place. Used by the FFI wrapper so adjusting TTL doesn’t drop the warmed cache (a fresh with_ttl(self) would clone all Arcs except the cache is held by &mut self — the in-place mutation preserves the inner Arc<RwLock<HashMap<...>>>).

Source

pub fn set_deadline_mut(&mut self, deadline: Duration)

Override the per-call deadline in place. Same rationale as Self::set_ttl_mut — preserves the cache state across FFI-side deadline adjustments.

Source

pub async fn query_latest( &self, target_node_id: u64, kind: u16, ) -> Result<Vec<SummaryAnnouncement>, FoldQueryClientError>

Query the aggregator for its latest cached summaries. Cache hit → return immediately; miss → issue RPC, cache the result, return.

target_node_id is the aggregator replica to query; operator tooling typically finds it via the capability index (role:aggregator tag) or the existing MeshNode::find_* helpers.

Source

pub async fn query_with_service( &self, target_node_id: u64, service: &str, kind: u16, ) -> Result<Vec<SummaryAnnouncement>, FoldQueryClientError>

Same as Self::query_latest but with a caller-supplied service name. Useful when a node runs multiple aggregators registered under distinct service names.

Source

pub async fn query_summarize_now( &self, target_node_id: u64, kind: u16, ) -> Result<Vec<SummaryAnnouncement>, FoldQueryClientError>

Issue a SummarizeNow query — never cached; always hits the wire. Use when the staleness tolerance is tighter than summary_interval.

Source

pub fn invalidate_cache(&self)

Drop every cached entry. Operator tooling calls this after a topology change (e.g. a placement migration) so the next query re-resolves against the new aggregator replica.

Source

pub fn invalidate_target(&self, target_node_id: u64)

Drop just the entries matching target_node_id. Used when a single replica is known stale but the rest of the cache is still warm.

Trait Implementations§

Source§

impl Clone for FoldQueryClient

Source§

fn clone(&self) -> FoldQueryClient

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

Auto Trait Implementations§

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> 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> Same for T

Source§

type Output = T

Should always be Self
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<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