pub struct FoldQueryHandler { /* private fields */ }Expand description
RpcHandler implementation that answers fold.query
requests from a hosted AggregatorDaemon. Construct via
AggregatorDaemon::query_handler and pass to
crate::adapter::net::MeshNode::serve_rpc under
FOLD_QUERY_SERVICE.
Implementations§
Source§impl FoldQueryHandler
impl FoldQueryHandler
Sourcepub fn new(aggregator: Arc<AggregatorDaemon>) -> Self
pub fn new(aggregator: Arc<AggregatorDaemon>) -> Self
Wrap an aggregator daemon as an RPC handler.
Trait Implementations§
Source§impl RpcHandler for FoldQueryHandler
impl RpcHandler for FoldQueryHandler
Source§fn call<'life0, 'async_trait>(
&'life0 self,
ctx: RpcContext,
) -> Pin<Box<dyn Future<Output = Result<RpcResponsePayload, RpcHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
ctx: RpcContext,
) -> Pin<Box<dyn Future<Output = Result<RpcResponsePayload, RpcHandlerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process one request and return the response payload. The
fold spawns this in a tokio task; the fold itself doesn’t
block on it. Handlers should respect
ctx.cancellation for
cooperative early-abort.Auto Trait Implementations§
impl !RefUnwindSafe for FoldQueryHandler
impl !UnwindSafe for FoldQueryHandler
impl Freeze for FoldQueryHandler
impl Send for FoldQueryHandler
impl Sync for FoldQueryHandler
impl Unpin for FoldQueryHandler
impl UnsafeUnpin for FoldQueryHandler
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
Mutably borrows from an owned value. Read more