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§
Sourcefn client(&self) -> &FloraServiceClient
fn client(&self) -> &FloraServiceClient
Returns a reference to the underlying tarpc client used by this bridge.
Provided Methods§
Sourceasync fn ping(&self) -> Result<String>
async fn ping(&self) -> Result<String>
Pings the flora server.
Returns the expected PONG response on success.
Sourceasync fn add_record(&self, record: RecordParams) -> Result<RecordId>
async fn add_record(&self, record: RecordParams) -> Result<RecordId>
Adds a single record to the flora archive.
Sourceasync fn count(&self) -> Result<i64>
async fn count(&self) -> Result<i64>
Queries the backend for the number of records it currently stores.
Sourceasync fn get_records(&self, record_ids: RecordIds) -> Result<Arc<Vec<Record>>>
async fn get_records(&self, record_ids: RecordIds) -> Result<Arc<Vec<Record>>>
Queries the flora backend for records with the given IDs.
Sourceasync fn search(
&self,
search_parameters: SearchParameters,
) -> Result<SearchResult>
async fn search( &self, search_parameters: SearchParameters, ) -> Result<SearchResult>
Sends a search request to the flora backend.
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.