Struct indradb::MemoryDatastore
source · pub struct MemoryDatastore { /* private fields */ }Expand description
An in-memory datastore.
Implementations§
source§impl MemoryDatastore
impl MemoryDatastore
sourcepub fn read<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, BincodeError>
👎Deprecated: use read_msgpack, as it supports properties
pub fn read<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, BincodeError>
read_msgpack, as it supports propertiesReads a persisted image from disk. Calls to sync will overwrite the
file at the specified path. For historic reasons, this uses bincode,
however bincode cannot serialize properties. If your graph needs
persistent properties, use read_msgpack.
Arguments
path: The path to the persisted image.
sourcepub fn read_msgpack<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, RmpDecodeError>
pub fn read_msgpack<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, RmpDecodeError>
Reads a persisted image from disk. Calls to sync will overwrite the file at the specified path. Uses msgpack, which unlike bincode supports properties.
Arguments
path: The path to the persisted image.
sourcepub fn create<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, BincodeError>
👎Deprecated: use create_msgpack, as it supports properties
pub fn create<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, BincodeError>
create_msgpack, as it supports propertiesCreates a new datastore. Calls to sync will overwrite the file at the
specified path, but as opposed to read, this will not read the file
first. For historic reasons, this uses bincode, however bincode cannot
serialize properties. If your graph needs persistent properties, use
create_msgpack.
Arguments
path: The path to the persisted image.
sourcepub fn create_msgpack<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, BincodeError>
pub fn create_msgpack<P: Into<PathBuf>>(
path: P
) -> StdResult<MemoryDatastore, BincodeError>
Creates a new datastore. Calls to sync will overwrite the file at the
specified path, but as opposed to read, this will not read the file
first. Uses msgpack, which unlike bincode supports properties.
Arguments
path: The path to the persisted image.
Trait Implementations§
source§impl Clone for MemoryDatastore
impl Clone for MemoryDatastore
source§fn clone(&self) -> MemoryDatastore
fn clone(&self) -> MemoryDatastore
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Datastore for MemoryDatastore
impl Datastore for MemoryDatastore
source§fn sync(&self) -> Result<()>
fn sync(&self) -> Result<()>
source§fn create_vertex(&self, vertex: &Vertex) -> Result<bool>
fn create_vertex(&self, vertex: &Vertex) -> Result<bool>
source§fn get_vertices(&self, q: VertexQuery) -> Result<Vec<Vertex>>
fn get_vertices(&self, q: VertexQuery) -> Result<Vec<Vertex>>
source§fn delete_vertices(&self, q: VertexQuery) -> Result<()>
fn delete_vertices(&self, q: VertexQuery) -> Result<()>
source§fn get_vertex_count(&self) -> Result<u64>
fn get_vertex_count(&self) -> Result<u64>
source§fn create_edge(&self, key: &EdgeKey) -> Result<bool>
fn create_edge(&self, key: &EdgeKey) -> Result<bool>
source§fn get_edges(&self, q: EdgeQuery) -> Result<Vec<Edge>>
fn get_edges(&self, q: EdgeQuery) -> Result<Vec<Edge>>
source§fn delete_edges(&self, q: EdgeQuery) -> Result<()>
fn delete_edges(&self, q: EdgeQuery) -> Result<()>
source§fn get_edge_count(
&self,
id: Uuid,
t: Option<&Identifier>,
direction: EdgeDirection
) -> Result<u64>
fn get_edge_count(
&self,
id: Uuid,
t: Option<&Identifier>,
direction: EdgeDirection
) -> Result<u64>
source§fn get_vertex_properties(
&self,
q: VertexPropertyQuery
) -> Result<Vec<VertexProperty>>
fn get_vertex_properties(
&self,
q: VertexPropertyQuery
) -> Result<Vec<VertexProperty>>
source§fn get_all_vertex_properties(
&self,
q: VertexQuery
) -> Result<Vec<VertexProperties>>
fn get_all_vertex_properties(
&self,
q: VertexQuery
) -> Result<Vec<VertexProperties>>
source§fn set_vertex_properties(
&self,
q: VertexPropertyQuery,
value: Value
) -> Result<()>
fn set_vertex_properties(
&self,
q: VertexPropertyQuery,
value: Value
) -> Result<()>
source§fn delete_vertex_properties(&self, q: VertexPropertyQuery) -> Result<()>
fn delete_vertex_properties(&self, q: VertexPropertyQuery) -> Result<()>
source§fn get_edge_properties(&self, q: EdgePropertyQuery) -> Result<Vec<EdgeProperty>>
fn get_edge_properties(&self, q: EdgePropertyQuery) -> Result<Vec<EdgeProperty>>
source§fn get_all_edge_properties(&self, q: EdgeQuery) -> Result<Vec<EdgeProperties>>
fn get_all_edge_properties(&self, q: EdgeQuery) -> Result<Vec<EdgeProperties>>
source§fn set_edge_properties(&self, q: EdgePropertyQuery, value: Value) -> Result<()>
fn set_edge_properties(&self, q: EdgePropertyQuery, value: Value) -> Result<()>
source§fn delete_edge_properties(&self, q: EdgePropertyQuery) -> Result<()>
fn delete_edge_properties(&self, q: EdgePropertyQuery) -> Result<()>
fn index_property(&self, name: Identifier) -> Result<()>
source§fn transaction(&self) -> Result<Self>where
Self: Sized,
fn transaction(&self) -> Result<Self>where
Self: Sized,
source§fn create_vertex_from_type(&self, t: Identifier) -> Result<Uuid>
fn create_vertex_from_type(&self, t: Identifier) -> Result<Uuid>
create_vertex, this is used when you do not want to manually specify
the vertex’s UUID. Returns the new vertex’s UUID. Read more