pub struct PyVertex { /* private fields */ }
Expand description

A vertex (or node) in the graph.

Implementations§

source§

impl PyVertex

Defines the Vertex, which represents a vertex in the graph. A vertex is a node in the graph, and can have properties and edges. It can also be used to navigate the graph.

source

pub fn id(&self) -> u64

Returns the id of the vertex. This is a unique identifier for the vertex.

Returns: The id of the vertex as an integer.

source

pub fn name(&self) -> String

Returns the name of the vertex.

Returns: The name of the vertex as a string.

source

pub fn earliest_time(&self) -> Option<i64>

Returns the earliest time that the vertex exists.

Arguments: None

Returns: The earliest time that the vertex exists as an integer.

source

pub fn earliest_date_time(&self) -> Option<NaiveDateTime>

Returns the earliest datetime that the vertex exists.

Arguments: None

Returns: The earliest datetime that the vertex exists as an integer.

source

pub fn latest_time(&self) -> Option<i64>

Returns the latest time that the vertex exists.

Returns: The latest time that the vertex exists as an integer.

source

pub fn latest_date_time(&self) -> Option<NaiveDateTime>

Returns the latest datetime that the vertex exists.

Arguments: None

Returns: The latest datetime that the vertex exists as an integer.

source

pub fn property( &self, name: String, include_static: Option<bool> ) -> Option<Prop>

Gets the property value of this vertex given the name of the property.

Arguments: name: The name of the property. include_static: Whether to include static properties. Defaults to true.

Returns: The property value as a Prop object.

source

pub fn property_history(&self, name: String) -> Vec<(i64, Prop)>

Returns the history of a property value of a vertex at all times

Arguments: name: The name of the property.

Returns: A list of tuples of the form (time, value) where time is an integer and value is a Prop object.

source

pub fn properties(&self, include_static: Option<bool>) -> HashMap<String, Prop>

Returns all the properties of the vertex as a dictionary.

Arguments: include_static: Whether to include static properties. Defaults to true.

Returns: A dictionary of the form {name: value} where name is a string and value is a Prop object.

source

pub fn property_histories(&self) -> HashMap<String, Vec<(i64, Prop)>>

Returns all the properties of the vertex as a dictionary including the history of each property.

Arguments: include_static: Whether to include static properties. Defaults to true.

Returns: A dictionary of the form {name: [(time, value)]} where name is a string, time is an integer, and value is a Prop object.

source

pub fn property_names(&self, include_static: Option<bool>) -> Vec<String>

Returns the names of all the properties of the vertex.

Arguments: include_static: Whether to include static properties. Defaults to true.

Returns: A list of strings of propert names.

source

pub fn has_property(&self, name: String, include_static: Option<bool>) -> bool

Checks if a property exists on this vertex.

Arguments: name: The name of the property. include_static: Whether to include static properties. Defaults to true.

Returns: True if the property exists, false otherwise.

source

pub fn has_static_property(&self, name: String) -> bool

Checks if a static property exists on this vertex.

Arguments: name: The name of the property.

Returns: True if the property exists, false otherwise.

source

pub fn static_property(&self, name: String) -> Option<Prop>

Returns the static property value of this vertex given the name of the property.

Arguments: name: The name of the property.

Returns: The property value as a Prop object or None if the property does not exist.

source

pub fn degree(&self) -> usize

Get the degree of this vertex (i.e., the number of edges that are incident to it).

Returns The degree of this vertex.

source

pub fn in_degree(&self) -> usize

Get the in-degree of this vertex (i.e., the number of edges that are incident to it from other vertices).

Returns: The in-degree of this vertex.

source

pub fn out_degree(&self) -> usize

Get the out-degree of this vertex (i.e., the number of edges that are incident to it from this vertex).

Returns: The out-degree of this vertex.

source

pub fn edges(&self) -> PyEdges

Get the edges that are pointing to or from this vertex.

Returns: A list of Edge objects.

source

pub fn in_edges(&self) -> PyEdges

Get the edges that are pointing to this vertex.

Returns: A list of Edge objects.

source

pub fn out_edges(&self) -> PyEdges

Get the edges that are pointing from this vertex.

Returns: A list of Edge objects.

source

pub fn neighbours(&self) -> PyPathFromVertex

Get the neighbours of this vertex.

Returns:

A list of Vertex objects.

source

pub fn in_neighbours(&self) -> PyPathFromVertex

Get the neighbours of this vertex that are pointing to it.

Returns: A list of Vertex objects.

source

pub fn out_neighbours(&self) -> PyPathFromVertex

Get the neighbours of this vertex that are pointing from it.

Returns: A list of Vertex objects.

source

pub fn start(&self) -> Option<i64>

Gets the earliest time that this vertex is valid.

Returns: The earliest time that this vertex is valid or None if the vertex is valid for all times.

source

pub fn start_date_time(&self) -> Option<NaiveDateTime>

Gets the earliest datetime that this vertex is valid

Returns: The earliest datetime that this vertex is valid or None if the vertex is valid for all times.

source

pub fn end(&self) -> Option<i64>

Gets the latest time that this vertex is valid.

Returns: The latest time that this vertex is valid or None if the vertex is valid for all times.

source

pub fn end_date_time(&self) -> Option<NaiveDateTime>

Gets the latest datetime that this vertex is valid

Returns: The latest datetime that this vertex is valid or None if the vertex is valid for all times.

source

pub fn window( &self, t_start: Option<&PyAny>, t_end: Option<&PyAny> ) -> PyResult<PyVertex>

Create a view of the vertex including all events between t_start (inclusive) and t_end (exclusive)

Arguments: t_start (int): The start time of the window. Defaults to the start time of the vertex. t_end (int): The end time of the window. Defaults to the end time of the vertex.

Returns: A PyVertex object.

source

pub fn at(&self, end: &PyAny) -> PyResult<PyVertex>

Create a view of the vertex including all events at t.

Arguments: end (int): The time of the window.

Returns: A PyVertex object.

source

pub fn default_layer(&self) -> PyVertex

Create a view including all the edges in the default layer

Returns: a view including all the edges in the default layer

source

pub fn layer(&self, name: &str) -> Option<PyVertex>

Create a view including all the edges in the layer name

Arguments: name (str) : the name of the layer

Returns: a view including all the edges in the layer name

source

pub fn history(&self) -> Vec<i64>

Returns the history of a vertex, including vertex additions and changes made to vertex.

Returns: A list of timestamps of the event history of vertex.

source

pub fn __getitem__(&self, name: String) -> Option<Prop>

source

pub fn __repr__(&self) -> String

Display the vertex as a string.

Trait Implementations§

source§

impl Clone for PyVertex

source§

fn clone(&self) -> PyVertex

Returns a copy 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 From<PyVertex> for VertexRef

Converts a python vertex into a rust vertex.

source§

fn from(value: PyVertex) -> Self

Converts to this type from the input type.
source§

impl<G: GraphViewOps + IntoDynamic> From<VertexView<G>> for PyVertex

source§

fn from(value: VertexView<G>) -> Self

Converts to this type from the input type.
source§

impl IntoPy<Py<PyAny>> for PyVertex

source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
source§

impl PyClass for PyVertex

§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for PyVertex

source§

const DOC: &'static str = _

Class doc string
source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
§

type Layout = PyCell<PyVertex>

Layout
§

type BaseType = PyAny

Base class
§

type ThreadChecker = ThreadCheckerStub<PyVertex>

This handles following two situations: Read more
§

type Inventory = Pyo3MethodsInventoryForPyVertex

§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
source§

fn items_iter() -> PyClassItemsIter

source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

source§

fn dict_offset() -> Option<isize>

source§

fn weaklist_offset() -> Option<isize>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyVertex

§

type Holder = Option<PyRef<'py, PyVertex>>

source§

fn extract(obj: &'py PyAny, holder: &'a mut Self::Holder) -> PyResult<Self>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PyVertex

§

type Holder = Option<PyRefMut<'py, PyVertex>>

source§

fn extract(obj: &'py PyAny, holder: &'a mut Self::Holder) -> PyResult<Self>

source§

impl PyTypeInfo for PyVertex

§

type AsRefTarget = PyCell<PyVertex>

Utility type to make Py::as_ref work.
source§

const NAME: &'static str = _

Class name.
source§

const MODULE: Option<&'static str> = ::core::option::Option::None

Module name, if any.
source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
source§

fn type_object(py: Python<'_>) -> &PyType

Returns the safe abstraction over the type object.
source§

fn is_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type or a subclass of this type.
source§

fn is_exact_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type.
source§

impl Repr for PyVertex

source§

fn repr(&self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'a, T> FromPyObject<'a> for Twhere T: PyClass + Clone,

source§

fn extract(obj: &'a PyAny) -> Result<T, PyErr>

Extracts Self from the source PyObject.
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 Twhere 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> OkWrap<T> for Twhere T: IntoPy<Py<PyAny>>,

§

type Error = PyErr

source§

fn wrap(self, py: Python<'_>) -> Result<Py<PyAny>, PyErr>

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> PyErrArguments for Twhere T: IntoPy<Py<PyAny>> + Send + Sync,

source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
source§

impl<T> ToOwned for Twhere T: Clone,

§

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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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

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

§

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> PyTypeObject for Twhere T: PyTypeInfo,

source§

impl<T> Ungil for Twhere T: Send,