ServiceBridge

Trait ServiceBridge 

Source
pub trait ServiceBridge {
    // Required method
    fn client(&self) -> &FloraServiceClient;

    // Provided methods
    async fn ping(&self) -> Result<String> { ... }
    async fn add_record(&self, record: RecordParams) -> Result<RecordId> { ... }
    async fn count(&self) -> Result<i64> { ... }
    async fn get_records(
        &self,
        record_ids: RecordIds,
    ) -> Result<Arc<Vec<Record>>> { ... }
    async fn search(
        &self,
        search_parameters: SearchParameters,
    ) -> Result<SearchResult> { ... }
    async fn delete(&self, ids: Vec<RecordId>) -> Result<usize> { ... }
}
Expand description

Trait to “bridge” the user-facing application with the flora backend over omry_service::tarpc.

Required Methods§

Source

fn client(&self) -> &FloraServiceClient

Returns a reference to the underlying tarpc client used by this bridge.

Provided Methods§

Source

async fn ping(&self) -> Result<String>

Pings the flora server.

Returns the expected PONG response on success.

Source

async fn add_record(&self, record: RecordParams) -> Result<RecordId>

Adds a single record to the flora archive.

Source

async fn count(&self) -> Result<i64>

Queries the backend for the number of records it currently stores.

Source

async fn get_records(&self, record_ids: RecordIds) -> Result<Arc<Vec<Record>>>

Queries the flora backend for records with the given IDs.

Source

async fn search( &self, search_parameters: SearchParameters, ) -> Result<SearchResult>

Sends a search request to the flora backend.

Source

async fn delete(&self, ids: Vec<RecordId>) -> Result<usize>

Sends a requests for the Omry API to delete record(s) with the given IDs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§