Struct indradb_proto::indra_db_client::IndraDbClient
source · pub struct IndraDbClient<T> { /* private fields */ }
Implementations§
source§impl IndraDbClient<Channel>
impl IndraDbClient<Channel>
source§impl<T> IndraDbClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> IndraDbClient<T>where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>( inner: T, interceptor: F ) -> IndraDbClient<InterceptedService<T, F>>where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub async fn ping(
&mut self,
request: impl IntoRequest<()>
) -> Result<Response<()>, Status>
pub async fn ping( &mut self, request: impl IntoRequest<()> ) -> Result<Response<()>, Status>
Pings the server.
sourcepub async fn sync(
&mut self,
request: impl IntoRequest<()>
) -> Result<Response<()>, Status>
pub async fn sync( &mut self, request: impl IntoRequest<()> ) -> Result<Response<()>, Status>
Syncs persisted content. Depending on the datastore implementation, this has different meanings - including potentially being a no-op.
sourcepub async fn create_vertex(
&mut self,
request: impl IntoRequest<Vertex>
) -> Result<Response<CreateResponse>, Status>
pub async fn create_vertex( &mut self, request: impl IntoRequest<Vertex> ) -> Result<Response<CreateResponse>, Status>
Creates a new vertex.
sourcepub async fn create_vertex_from_type(
&mut self,
request: impl IntoRequest<Identifier>
) -> Result<Response<Uuid>, Status>
pub async fn create_vertex_from_type( &mut self, request: impl IntoRequest<Identifier> ) -> Result<Response<Uuid>, Status>
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.
sourcepub async fn create_edge(
&mut self,
request: impl IntoRequest<Edge>
) -> Result<Response<CreateResponse>, Status>
pub async fn create_edge( &mut self, request: impl IntoRequest<Edge> ) -> Result<Response<CreateResponse>, Status>
Creates a new edge.
sourcepub async fn get(
&mut self,
request: impl IntoRequest<Query>
) -> Result<Response<Streaming<QueryOutputValue>>, Status>
pub async fn get( &mut self, request: impl IntoRequest<Query> ) -> Result<Response<Streaming<QueryOutputValue>>, Status>
Gets values specified by a query.
sourcepub async fn delete(
&mut self,
request: impl IntoRequest<Query>
) -> Result<Response<()>, Status>
pub async fn delete( &mut self, request: impl IntoRequest<Query> ) -> Result<Response<()>, Status>
Deletes values specified by a query.
sourcepub async fn set_properties(
&mut self,
request: impl IntoRequest<SetPropertiesRequest>
) -> Result<Response<()>, Status>
pub async fn set_properties( &mut self, request: impl IntoRequest<SetPropertiesRequest> ) -> Result<Response<()>, Status>
Sets properties.
sourcepub async fn bulk_insert(
&mut self,
request: impl IntoStreamingRequest<Message = BulkInsertItem>
) -> Result<Response<()>, Status>
pub async fn bulk_insert( &mut self, request: impl IntoStreamingRequest<Message = BulkInsertItem> ) -> Result<Response<()>, Status>
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.
sourcepub async fn index_property(
&mut self,
request: impl IntoRequest<IndexPropertyRequest>
) -> Result<Response<()>, Status>
pub async fn index_property( &mut self, request: impl IntoRequest<IndexPropertyRequest> ) -> Result<Response<()>, Status>
Enables indexing on a specified property. When indexing is enabled on a property, it’s possible to query on its presence and values.
sourcepub async fn execute_plugin(
&mut self,
request: impl IntoRequest<ExecutePluginRequest>
) -> Result<Response<ExecutePluginResponse>, Status>
pub async fn execute_plugin( &mut self, request: impl IntoRequest<ExecutePluginRequest> ) -> Result<Response<ExecutePluginResponse>, Status>
Executes a plugin and returns back the response from the plugin.
Trait Implementations§
source§impl<T: Clone> Clone for IndraDbClient<T>
impl<T: Clone> Clone for IndraDbClient<T>
source§fn clone(&self) -> IndraDbClient<T>
fn clone(&self) -> IndraDbClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for IndraDbClient<T>where T: RefUnwindSafe,
impl<T> Send for IndraDbClient<T>where T: Send,
impl<T> Sync for IndraDbClient<T>where T: Sync,
impl<T> Unpin for IndraDbClient<T>where T: Unpin,
impl<T> UnwindSafe for IndraDbClient<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request