pub enum GraphStorage {
Mem(LockedGraph),
Unlocked(Arc<TemporalGraph>),
}Variants§
Mem(LockedGraph)
Unlocked(Arc<TemporalGraph>)
Implementations§
Source§impl GraphStorage
impl GraphStorage
Sourcepub fn ptr_eq(&self, other: &Self) -> bool
pub fn ptr_eq(&self, other: &Self) -> bool
Check if two storage instances point at the same underlying storage
pub fn mutable(&self) -> Result<&Arc<TemporalGraph>, MutationError>
pub fn is_immutable(&self) -> bool
pub fn lock(&self) -> Self
pub fn nodes(&self) -> NodesStorageEntry<'_>
pub fn internalise_node(&self, v: NodeRef<'_>) -> Option<VID>
pub fn unfiltered_num_nodes(&self) -> usize
pub fn unfiltered_num_edges(&self) -> usize
pub fn unfiltered_num_layers(&self) -> usize
pub fn core_nodes(&self) -> NodesStorage
pub fn core_node<'a>(&'a self, vid: VID) -> NodeStorageEntry<'a>
Sourcepub fn try_core_node<'a>(&'a self, vid: VID) -> Option<NodeStorageEntry<'a>>
pub fn try_core_node<'a>(&'a self, vid: VID) -> Option<NodeStorageEntry<'a>>
Try to get a node that may not be initialised yet
pub fn edges(&self) -> EdgesStorageRef<'_>
pub fn owned_edges(&self) -> EdgesStorage
pub fn edge_entry(&self, eid: EID) -> EdgeStorageEntry<'_>
pub fn layer_ids_iter( &self, layer_ids: &LayerIds, ) -> impl Iterator<Item = usize>
pub fn node_meta(&self) -> &Meta
pub fn edge_meta(&self) -> &Meta
pub fn graph_meta(&self) -> &GraphMeta
Trait Implementations§
Source§impl Clone for GraphStorage
impl Clone for GraphStorage
Source§fn clone(&self) -> GraphStorage
fn clone(&self) -> GraphStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CoreGraphOps for GraphStorage
impl CoreGraphOps for GraphStorage
fn core_graph(&self) -> &GraphStorage
fn id_type(&self) -> Option<GidType>
fn num_shards(&self) -> usize
Source§fn read_event_id(&self) -> usize
fn read_event_id(&self) -> usize
get the current sequence id without incrementing the counter
Source§fn unfiltered_num_nodes(&self) -> usize
fn unfiltered_num_nodes(&self) -> usize
get the number of nodes in the main graph
Source§fn unfiltered_num_edges(&self) -> usize
fn unfiltered_num_edges(&self) -> usize
get the number of edges in the main graph
Source§fn unfiltered_num_layers(&self) -> usize
fn unfiltered_num_layers(&self) -> usize
get the number of layers in the main graph
Source§fn single_layer(&self, layer_ids: &LayerIds) -> Option<usize>
fn single_layer(&self, layer_ids: &LayerIds) -> Option<usize>
Return the id of the single layer if
layer_ids reduces to a graph with a single layer, else Nonefn core_edges(&self) -> EdgesStorage
fn core_edge(&self, eid: EID) -> EdgeStorageEntry<'_>
fn core_nodes(&self) -> NodesStorage
fn core_node(&self, vid: VID) -> NodeStorageEntry<'_>
fn node_meta(&self) -> &Meta
fn edge_meta(&self) -> &Meta
fn graph_meta(&self) -> &GraphMeta
fn get_layer_name(&self, layer_id: usize) -> ArcStr
fn get_layer_id(&self, name: &str) -> Option<usize>
fn get_default_layer_id(&self) -> Option<usize>
Source§fn get_layer_names_from_ids(&self, layer_ids: &LayerIds) -> BoxedIter<ArcStr>
fn get_layer_names_from_ids(&self, layer_ids: &LayerIds) -> BoxedIter<ArcStr>
Get the layer name for a given id
Source§fn get_all_node_types(&self) -> Vec<ArcStr>
fn get_all_node_types(&self) -> Vec<ArcStr>
Get all node types
Source§fn node_type_id(&self, v: VID) -> usize
fn node_type_id(&self, v: VID) -> usize
Returns the type id of a node
Source§fn internalise_node(&self, v: NodeRef<'_>) -> Option<VID>
fn internalise_node(&self, v: NodeRef<'_>) -> Option<VID>
Gets the internal reference for an external node reference and keeps internal references unchanged.
Source§fn internalise_node_unchecked(&self, v: NodeRef<'_>) -> VID
fn internalise_node_unchecked(&self, v: NodeRef<'_>) -> VID
Gets the internal reference for an external node reference and keeps internal references unchanged. Assumes node exists!
Source§fn node_metadata(&self, v: VID, id: usize) -> Option<Prop>
fn node_metadata(&self, v: VID, id: usize) -> Option<Prop>
Gets a static property of a given node given the name and node reference. Read more
Source§fn node_metadata_ids(&self, v: VID) -> BoxedLIter<'_, usize>
fn node_metadata_ids(&self, v: VID) -> BoxedLIter<'_, usize>
Gets the keys of metadata of a given node Read more
Source§impl Debug for GraphStorage
impl Debug for GraphStorage
Source§impl Default for GraphStorage
impl Default for GraphStorage
Source§impl<'de> Deserialize<'de> for GraphStorage
impl<'de> Deserialize<'de> for GraphStorage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for GraphStorage
impl Display for GraphStorage
Source§impl From<TemporalGraph> for GraphStorage
impl From<TemporalGraph> for GraphStorage
Source§fn from(value: TemporalGraph) -> Self
fn from(value: TemporalGraph) -> Self
Converts to this type from the input type.
Source§impl InternalAdditionOps for GraphStorage
impl InternalAdditionOps for GraphStorage
type Error = MutationError
fn write_lock(&self) -> Result<WriteLockedGraph<'_>, Self::Error>
fn write_lock_nodes(&self) -> Result<WriteLockedNodes<'_>, Self::Error>
fn write_lock_edges(&self) -> Result<WriteLockedEdges<'_>, Self::Error>
fn reserve_event_ids(&self, num_ids: usize) -> Result<usize, Self::Error>
Source§fn resolve_layer(
&self,
layer: Option<&str>,
) -> Result<MaybeNew<usize>, Self::Error>
fn resolve_layer( &self, layer: Option<&str>, ) -> Result<MaybeNew<usize>, Self::Error>
map layer name to id and allocate a new layer if needed
Source§fn resolve_node(&self, id: NodeRef<'_>) -> Result<MaybeNew<VID>, Self::Error>
fn resolve_node(&self, id: NodeRef<'_>) -> Result<MaybeNew<VID>, Self::Error>
map external node id to internal id, allocating a new empty node if needed
fn set_node(&self, gid: GidRef<'_>, vid: VID) -> Result<(), Self::Error>
Source§fn resolve_node_and_type(
&self,
id: NodeRef<'_>,
node_type: &str,
) -> Result<MaybeNew<(MaybeNew<VID>, MaybeNew<usize>)>, Self::Error>
fn resolve_node_and_type( &self, id: NodeRef<'_>, node_type: &str, ) -> Result<MaybeNew<(MaybeNew<VID>, MaybeNew<usize>)>, Self::Error>
resolve a node and corresponding type, outer MaybeNew tracks whether the type assignment is new for the node even if both node and type already existed.
Source§fn resolve_graph_property(
&self,
prop: &str,
dtype: PropType,
is_static: bool,
) -> Result<MaybeNew<usize>, Self::Error>
fn resolve_graph_property( &self, prop: &str, dtype: PropType, is_static: bool, ) -> Result<MaybeNew<usize>, Self::Error>
map property key to internal id, allocating new property if needed
Source§fn resolve_node_property(
&self,
prop: &str,
dtype: PropType,
is_static: bool,
) -> Result<MaybeNew<usize>, Self::Error>
fn resolve_node_property( &self, prop: &str, dtype: PropType, is_static: bool, ) -> Result<MaybeNew<usize>, Self::Error>
map property key to internal id, allocating new property if needed and checking property type.
returns
None if the type does not matchfn resolve_edge_property( &self, prop: &str, dtype: PropType, is_static: bool, ) -> Result<MaybeNew<usize>, Self::Error>
Source§fn internal_add_node(
&self,
t: TimeIndexEntry,
v: VID,
props: &[(usize, Prop)],
) -> Result<(), Self::Error>
fn internal_add_node( &self, t: TimeIndexEntry, v: VID, props: &[(usize, Prop)], ) -> Result<(), Self::Error>
add node update
Source§impl InternalDeletionOps for GraphStorage
impl InternalDeletionOps for GraphStorage
type Error = MutationError
fn internal_delete_edge( &self, t: TimeIndexEntry, src: VID, dst: VID, layer: usize, ) -> Result<MaybeNew<EID>, Self::Error>
fn internal_delete_existing_edge( &self, t: TimeIndexEntry, eid: EID, layer: usize, ) -> Result<(), Self::Error>
Source§impl InternalLayerOps for GraphStorage
impl InternalLayerOps for GraphStorage
Source§fn layer_ids_from_names(&self, key: Layer) -> Result<LayerIds, InvalidLayer>
fn layer_ids_from_names(&self, key: Layer) -> Result<LayerIds, InvalidLayer>
Get the layer id for the given layer name
Source§fn valid_layer_ids_from_names(&self, key: Layer) -> LayerIds
fn valid_layer_ids_from_names(&self, key: Layer) -> LayerIds
Get the valid layer ids for given layer names
Source§impl InternalPropertyAdditionOps for GraphStorage
impl InternalPropertyAdditionOps for GraphStorage
type Error = MutationError
fn internal_add_properties( &self, t: TimeIndexEntry, props: &[(usize, Prop)], ) -> Result<(), Self::Error>
fn internal_add_metadata( &self, props: &[(usize, Prop)], ) -> Result<(), Self::Error>
fn internal_update_metadata( &self, props: &[(usize, Prop)], ) -> Result<(), Self::Error>
fn internal_add_node_metadata( &self, vid: VID, props: &[(usize, Prop)], ) -> Result<EntryMut<'_, RwLockWriteGuard<'_, NodeSlot>>, Self::Error>
fn internal_update_node_metadata( &self, vid: VID, props: &[(usize, Prop)], ) -> Result<EntryMut<'_, RwLockWriteGuard<'_, NodeSlot>>, Self::Error>
fn internal_add_edge_metadata( &self, eid: EID, layer: usize, props: &[(usize, Prop)], ) -> Result<EdgeWGuard<'_>, Self::Error>
fn internal_update_edge_metadata( &self, eid: EID, layer: usize, props: &[(usize, Prop)], ) -> Result<EdgeWGuard<'_>, Self::Error>
Auto Trait Implementations§
impl Freeze for GraphStorage
impl !RefUnwindSafe for GraphStorage
impl Send for GraphStorage
impl Sync for GraphStorage
impl Unpin for GraphStorage
impl !UnwindSafe for GraphStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more