GraphStorage

Enum GraphStorage 

Source
pub enum GraphStorage {
    Mem(LockedGraph),
    Unlocked(Arc<TemporalGraph>),
}

Variants§

Implementations§

Source§

impl GraphStorage

Source

pub fn ptr_eq(&self, other: &Self) -> bool

Check if two storage instances point at the same underlying storage

Source

pub fn mutable(&self) -> Result<&Arc<TemporalGraph>, MutationError>

Source

pub fn is_immutable(&self) -> bool

Source

pub fn lock(&self) -> Self

Source

pub fn nodes(&self) -> NodesStorageEntry<'_>

Source

pub fn internalise_node(&self, v: NodeRef<'_>) -> Option<VID>

Source

pub fn unfiltered_num_nodes(&self) -> usize

Source

pub fn unfiltered_num_edges(&self) -> usize

Source

pub fn unfiltered_num_layers(&self) -> usize

Source

pub fn core_nodes(&self) -> NodesStorage

Source

pub fn core_node<'a>(&'a self, vid: VID) -> NodeStorageEntry<'a>

Source

pub fn try_core_node<'a>(&'a self, vid: VID) -> Option<NodeStorageEntry<'a>>

Try to get a node that may not be initialised yet

Source

pub fn edges(&self) -> EdgesStorageRef<'_>

Source

pub fn owned_edges(&self) -> EdgesStorage

Source

pub fn edge_entry(&self, eid: EID) -> EdgeStorageEntry<'_>

Source

pub fn layer_ids_iter( &self, layer_ids: &LayerIds, ) -> impl Iterator<Item = usize>

Source

pub fn node_meta(&self) -> &Meta

Source

pub fn edge_meta(&self) -> &Meta

Source

pub fn graph_meta(&self) -> &GraphMeta

Trait Implementations§

Source§

impl Clone for GraphStorage

Source§

fn clone(&self) -> GraphStorage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CoreGraphOps for GraphStorage

Source§

fn core_graph(&self) -> &GraphStorage

Source§

fn id_type(&self) -> Option<GidType>

Source§

fn num_shards(&self) -> usize

Source§

fn read_event_id(&self) -> usize

get the current sequence id without incrementing the counter
Source§

fn unfiltered_num_nodes(&self) -> usize

get the number of nodes in the main graph
Source§

fn unfiltered_num_edges(&self) -> usize

get the number of edges in the main graph
Source§

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>

Return the id of the single layer if layer_ids reduces to a graph with a single layer, else None
Source§

fn core_edges(&self) -> EdgesStorage

Source§

fn core_edge(&self, eid: EID) -> EdgeStorageEntry<'_>

Source§

fn core_nodes(&self) -> NodesStorage

Source§

fn core_node(&self, vid: VID) -> NodeStorageEntry<'_>

Source§

fn node_meta(&self) -> &Meta

Source§

fn edge_meta(&self) -> &Meta

Source§

fn graph_meta(&self) -> &GraphMeta

Source§

fn get_layer_name(&self, layer_id: usize) -> ArcStr

Source§

fn get_layer_id(&self, name: &str) -> Option<usize>

Source§

fn get_default_layer_id(&self) -> Option<usize>

Source§

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>

Get all node types
Source§

fn node_id(&self, v: VID) -> GID

Returns the external ID for a node
Source§

fn node_name(&self, v: VID) -> String

Returns the string name for a node
Source§

fn node_type(&self, v: VID) -> Option<ArcStr>

Returns the type of node
Source§

fn node_type_id(&self, v: VID) -> usize

Returns the type id of a node
Source§

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

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>

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>

Gets the keys of metadata of a given node Read more
Source§

fn temporal_node_prop_ids(&self, v: VID) -> Box<dyn Iterator<Item = usize> + '_>

Returns a vector of all ids of temporal properties within the given node Read more
Source§

impl Debug for GraphStorage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GraphStorage

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for GraphStorage

Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<TemporalGraph> for GraphStorage

Source§

fn from(value: TemporalGraph) -> Self

Converts to this type from the input type.
Source§

impl InternalAdditionOps for GraphStorage

Source§

type Error = MutationError

Source§

fn write_lock(&self) -> Result<WriteLockedGraph<'_>, Self::Error>

Source§

fn write_lock_nodes(&self) -> Result<WriteLockedNodes<'_>, Self::Error>

Source§

fn write_lock_edges(&self) -> Result<WriteLockedEdges<'_>, Self::Error>

Source§

fn next_event_id(&self) -> Result<usize, Self::Error>

get the sequence id for the next event
Source§

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>

map layer name to id and allocate a new layer if needed
Source§

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
Source§

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>

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>

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>

map property key to internal id, allocating new property if needed and checking property type. returns None if the type does not match
Source§

fn 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>

add node update
Source§

fn internal_add_edge( &self, t: TimeIndexEntry, src: VID, dst: VID, props: &[(usize, Prop)], layer: usize, ) -> Result<MaybeNew<EID>, Self::Error>

add edge update
Source§

fn internal_add_edge_update( &self, t: TimeIndexEntry, edge: EID, props: &[(usize, Prop)], layer: usize, ) -> Result<(), Self::Error>

add update for an existing edge
Source§

impl InternalDeletionOps for GraphStorage

Source§

impl InternalLayerOps for GraphStorage

Source§

fn layer_ids(&self) -> &LayerIds

get the layer ids for the graph view
Source§

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

Get the valid layer ids for given layer names
Source§

impl InternalPropertyAdditionOps for GraphStorage

Source§

type Error = MutationError

Source§

fn internal_add_properties( &self, t: TimeIndexEntry, props: &[(usize, Prop)], ) -> Result<(), Self::Error>

Source§

fn internal_add_metadata( &self, props: &[(usize, Prop)], ) -> Result<(), Self::Error>

Source§

fn internal_update_metadata( &self, props: &[(usize, Prop)], ) -> Result<(), Self::Error>

Source§

fn internal_add_node_metadata( &self, vid: VID, props: &[(usize, Prop)], ) -> Result<EntryMut<'_, RwLockWriteGuard<'_, NodeSlot>>, Self::Error>

Source§

fn internal_update_node_metadata( &self, vid: VID, props: &[(usize, Prop)], ) -> Result<EntryMut<'_, RwLockWriteGuard<'_, NodeSlot>>, Self::Error>

Source§

fn internal_add_edge_metadata( &self, eid: EID, layer: usize, props: &[(usize, Prop)], ) -> Result<EdgeWGuard<'_>, Self::Error>

Source§

fn internal_update_edge_metadata( &self, eid: EID, layer: usize, props: &[(usize, Prop)], ) -> Result<EdgeWGuard<'_>, Self::Error>

Source§

impl Serialize for GraphStorage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,