Trait indradb::Transaction [−][src]
Specifies a transaction implementation, which are provided by datastores.
All datastore manipulations are done through transactions. Datastore implementations carry different guarantees. Depending on the implementation, it may not be possible to rollback the changes on error. See the documentation of individual implementations for details.
Required methods
fn create_vertex(&self, vertex: &Vertex) -> Result<bool>
[src]
Creates a new vertex. Returns whether the vertex was successfully created - if this is false, it's because a vertex with the same UUID already exists.
Arguments
vertex
: The vertex to create.
fn get_vertices<Q: Into<VertexQuery>>(&self, q: Q) -> Result<Vec<Vertex>>
[src]
fn delete_vertices<Q: Into<VertexQuery>>(&self, q: Q) -> Result<()>
[src]
fn get_vertex_count(&self) -> Result<u64>
[src]
Gets the number of vertices in the datastore.
fn create_edge(&self, key: &EdgeKey) -> Result<bool>
[src]
Creates a new edge. If the edge already exists, this will update it with a new update datetime. Returns whether the edge was successfully created - if this is false, it's because one of the specified vertices is missing.
Arguments
key
: The edge to create.
fn get_edges<Q: Into<EdgeQuery>>(&self, q: Q) -> Result<Vec<Edge>>
[src]
fn delete_edges<Q: Into<EdgeQuery>>(&self, q: Q) -> Result<()>
[src]
fn get_edge_count(
&self,
id: Uuid,
t: Option<&Type>,
direction: EdgeDirection
) -> Result<u64>
[src]
&self,
id: Uuid,
t: Option<&Type>,
direction: EdgeDirection
) -> Result<u64>
Gets the number of edges associated with a vertex.
Arguments
id
: The id of the vertex.t
: Only get the count for a specified edge type.direction
: The direction of edges to get.
fn get_vertex_properties(
&self,
q: VertexPropertyQuery
) -> Result<Vec<VertexProperty>>
[src]
&self,
q: VertexPropertyQuery
) -> Result<Vec<VertexProperty>>
fn get_all_vertex_properties<Q: Into<VertexQuery>>(
&self,
q: Q
) -> Result<Vec<VertexProperties>>
[src]
&self,
q: Q
) -> Result<Vec<VertexProperties>>
fn set_vertex_properties(
&self,
q: VertexPropertyQuery,
value: &JsonValue
) -> Result<()>
[src]
&self,
q: VertexPropertyQuery,
value: &JsonValue
) -> Result<()>
fn delete_vertex_properties(&self, q: VertexPropertyQuery) -> Result<()>
[src]
fn get_edge_properties(&self, q: EdgePropertyQuery) -> Result<Vec<EdgeProperty>>
[src]
fn get_all_edge_properties<Q: Into<EdgeQuery>>(
&self,
q: Q
) -> Result<Vec<EdgeProperties>>
[src]
&self,
q: Q
) -> Result<Vec<EdgeProperties>>
fn set_edge_properties(
&self,
q: EdgePropertyQuery,
value: &JsonValue
) -> Result<()>
[src]
&self,
q: EdgePropertyQuery,
value: &JsonValue
) -> Result<()>
fn delete_edge_properties(&self, q: EdgePropertyQuery) -> Result<()>
[src]
Provided methods
fn create_vertex_from_type(&self, t: Type) -> Result<Uuid>
[src]
Creates a new vertex with just a type specification. As opposed to
create_vertex
, this is used when you do not want to manually specify
the vertex's UUID. Returns the new vertex's UUID.
Arguments
t
: The type of the vertex to create.
Implementors
impl Transaction for MemoryTransaction
[src]
fn create_vertex(&self, vertex: &Vertex) -> Result<bool>
[src]
fn get_vertices<Q: Into<VertexQuery>>(&self, q: Q) -> Result<Vec<Vertex>>
[src]
fn delete_vertices<Q: Into<VertexQuery>>(&self, q: Q) -> Result<()>
[src]
fn get_vertex_count(&self) -> Result<u64>
[src]
fn create_edge(&self, key: &EdgeKey) -> Result<bool>
[src]
fn get_edges<Q: Into<EdgeQuery>>(&self, q: Q) -> Result<Vec<Edge>>
[src]
fn delete_edges<Q: Into<EdgeQuery>>(&self, q: Q) -> Result<()>
[src]
fn get_edge_count(
&self,
id: Uuid,
t: Option<&Type>,
direction: EdgeDirection
) -> Result<u64>
[src]
&self,
id: Uuid,
t: Option<&Type>,
direction: EdgeDirection
) -> Result<u64>
fn get_vertex_properties(
&self,
q: VertexPropertyQuery
) -> Result<Vec<VertexProperty>>
[src]
&self,
q: VertexPropertyQuery
) -> Result<Vec<VertexProperty>>
fn get_all_vertex_properties<Q: Into<VertexQuery>>(
&self,
q: Q
) -> Result<Vec<VertexProperties>>
[src]
&self,
q: Q
) -> Result<Vec<VertexProperties>>
fn set_vertex_properties(
&self,
q: VertexPropertyQuery,
value: &JsonValue
) -> Result<()>
[src]
&self,
q: VertexPropertyQuery,
value: &JsonValue
) -> Result<()>
fn delete_vertex_properties(&self, q: VertexPropertyQuery) -> Result<()>
[src]
fn get_edge_properties(&self, q: EdgePropertyQuery) -> Result<Vec<EdgeProperty>>
[src]
fn get_all_edge_properties<Q: Into<EdgeQuery>>(
&self,
q: Q
) -> Result<Vec<EdgeProperties>>
[src]
&self,
q: Q
) -> Result<Vec<EdgeProperties>>
fn set_edge_properties(
&self,
q: EdgePropertyQuery,
value: &JsonValue
) -> Result<()>
[src]
&self,
q: EdgePropertyQuery,
value: &JsonValue
) -> Result<()>