Trait indradb_proto::indra_db_server::IndraDb
source · pub trait IndraDb: Send + Sync + 'static {
type GetStream: Stream<Item = Result<QueryOutputValue, Status>> + Send + 'static;
// Required methods
fn ping<'life0, 'async_trait>(
&'life0 self,
request: Request<()>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync<'life0, 'async_trait>(
&'life0 self,
request: Request<()>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_vertex<'life0, 'async_trait>(
&'life0 self,
request: Request<Vertex>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_vertex_from_type<'life0, 'async_trait>(
&'life0 self,
request: Request<Identifier>
) -> Pin<Box<dyn Future<Output = Result<Response<Uuid>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_edge<'life0, 'async_trait>(
&'life0 self,
request: Request<Edge>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get<'life0, 'async_trait>(
&'life0 self,
request: Request<Query>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
request: Request<Query>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_properties<'life0, 'async_trait>(
&'life0 self,
request: Request<SetPropertiesRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn bulk_insert<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<BulkInsertItem>>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn index_property<'life0, 'async_trait>(
&'life0 self,
request: Request<IndexPropertyRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn execute_plugin<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecutePluginRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ExecutePluginResponse>, 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 IndraDbServer.
Required Associated Types§
Required Methods§
sourcefn ping<'life0, 'async_trait>(
&'life0 self,
request: Request<()>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ping<'life0, 'async_trait>( &'life0 self, request: Request<()> ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Pings the server.
sourcefn sync<'life0, 'async_trait>(
&'life0 self,
request: Request<()>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync<'life0, 'async_trait>( &'life0 self, request: Request<()> ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Syncs persisted content. Depending on the datastore implementation, this has different meanings - including potentially being a no-op.
sourcefn create_vertex<'life0, 'async_trait>(
&'life0 self,
request: Request<Vertex>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_vertex<'life0, 'async_trait>( &'life0 self, request: Request<Vertex> ) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Creates a new vertex.
sourcefn create_vertex_from_type<'life0, 'async_trait>(
&'life0 self,
request: Request<Identifier>
) -> Pin<Box<dyn Future<Output = Result<Response<Uuid>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_vertex_from_type<'life0, 'async_trait>( &'life0 self, request: Request<Identifier> ) -> Pin<Box<dyn Future<Output = Result<Response<Uuid>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Creates a new vertex with just a type specification. As opposed to
CreateVertex
, this is used when you do not want to manually specify
the vertex’s UUID. Returns the new vertex’s UUID.
sourcefn create_edge<'life0, 'async_trait>(
&'life0 self,
request: Request<Edge>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_edge<'life0, 'async_trait>( &'life0 self, request: Request<Edge> ) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Creates a new edge.
sourcefn get<'life0, 'async_trait>(
&'life0 self,
request: Request<Query>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>( &'life0 self, request: Request<Query> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Gets values specified by a query.
sourcefn delete<'life0, 'async_trait>(
&'life0 self,
request: Request<Query>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>( &'life0 self, request: Request<Query> ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Deletes values specified by a query.
sourcefn set_properties<'life0, 'async_trait>(
&'life0 self,
request: Request<SetPropertiesRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_properties<'life0, 'async_trait>( &'life0 self, request: Request<SetPropertiesRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Sets properties.
sourcefn bulk_insert<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<BulkInsertItem>>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bulk_insert<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<BulkInsertItem>> ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Bulk inserts many vertices, edges, and/or properties.
Note that datastores have discretion on how to approach safeguard vs performance tradeoffs. In particular:
- If the datastore is disk-backed, it may or may not flush before returning.
- The datastore might not verify for correctness; e.g., it might not ensure that the relevant vertices exist before inserting an edge.
sourcefn index_property<'life0, 'async_trait>(
&'life0 self,
request: Request<IndexPropertyRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn index_property<'life0, 'async_trait>( &'life0 self, request: Request<IndexPropertyRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Enables indexing on a specified property. When indexing is enabled on a property, it’s possible to query on its presence and values.
sourcefn execute_plugin<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecutePluginRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ExecutePluginResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_plugin<'life0, 'async_trait>( &'life0 self, request: Request<ExecutePluginRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<ExecutePluginResponse>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Executes a plugin and returns back the response from the plugin.