Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

SyncHandler

Trait SyncHandler 

Source
pub trait SyncHandler: Send + Sync {
    // Required method
    fn handle_request<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        request: &'life1 SyncRequest,
        context: &'life2 RequestContext,
    ) -> Pin<Box<dyn Future<Output = SyncResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for handling sync requests with database access.

Implementations of this trait can process sync requests and generate appropriate responses, with full access to the database backend for storing and retrieving entries.

Required Methods§

Source

fn handle_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, request: &'life1 SyncRequest, context: &'life2 RequestContext, ) -> Pin<Box<dyn Future<Output = SyncResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Handle a sync request and generate an appropriate response.

This is the main entry point for processing sync messages, regardless of which transport they arrived through.

§Arguments
  • request - The sync request to process
  • context - Context about the request (remote address, etc.)
§Returns

The appropriate response for the given request.

Implementors§