Trait Scanner

Source
pub trait Scanner:
    Send
    + Sync
    + 'static {
    type ScanStream: Stream<Item = Result<ScanResponse, Status>> + Send + 'static;

    // Required methods
    fn get_info<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Empty>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<InfoReply>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clear_results<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ClearResultsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_keys<'life0, 'async_trait>(
        &'life0 self,
        request: Request<DeleteKeysRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_results<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetResultsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetResultsResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register_keys<'life0, 'async_trait>(
        &'life0 self,
        request: Request<RegisterKeysRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<RegisterKeysResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn scan<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ScanRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ScanStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with ScannerServer.

Required Associated Types§

Source

type ScanStream: Stream<Item = Result<ScanResponse, Status>> + Send + 'static

Server streaming response type for the Scan method.

Required Methods§

Source

fn get_info<'life0, 'async_trait>( &'life0 self, request: Request<Empty>, ) -> Pin<Box<dyn Future<Output = Result<Response<InfoReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get information about the scanner service.

Source

fn clear_results<'life0, 'async_trait>( &'life0 self, request: Request<ClearResultsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clear results for a set of keys without removing the keys from the scanner. This request does not stop the scanner from scanning blocks for these keys, it only clears past results.

Source

fn delete_keys<'life0, 'async_trait>( &'life0 self, request: Request<DeleteKeysRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes a set of keys and their results from the scanner. This request stop the scanner from scanning blocks for the these keys.

Source

fn get_results<'life0, 'async_trait>( &'life0 self, request: Request<GetResultsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetResultsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all data we have stored for the given keys.

Source

fn register_keys<'life0, 'async_trait>( &'life0 self, request: Request<RegisterKeysRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<RegisterKeysResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submits scanning keys to the scanner.

Source

fn scan<'life0, 'async_trait>( &'life0 self, request: Request<ScanRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ScanStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register keys and listen to the results

Implementors§

Source§

impl<ScanService> Scanner for ScannerRPC<ScanService>
where ScanService: Service<Request, Response = Response, Error = Box<dyn Error + Send + Sync + 'static>> + Clone + Send + Sync + 'static, <ScanService as Service<Request>>::Future: Send,

Source§

type ScanStream = Pin<Box<dyn Stream<Item = Result<ScanResponse, Status>> + Send>>