pub struct PyGraphView {
    pub graph: DynamicGraph,
}
Expand description

Graph view is a read-only version of a graph at a certain point in time.

Fields§

§graph: DynamicGraph

Implementations§

source§

impl PyGraphView

The API for querying a view of the graph in a read-only state

source

pub fn get_unique_layers(&self) -> Vec<String>

source

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

Timestamp of earliest activity in the graph

Returns: the timestamp of the earliest activity in the graph

source

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

DateTime of earliest activity in the graph

Returns: the datetime of the earliest activity in the graph

source

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

Timestamp of latest activity in the graph

Returns: the timestamp of the latest activity in the graph

source

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

DateTime of latest activity in the graph

Returns: the datetime of the latest activity in the graph

source

pub fn num_edges(&self) -> usize

Number of edges in the graph

Returns: the number of edges in the graph

source

pub fn num_vertices(&self) -> usize

Number of vertices in the graph

Returns: the number of vertices in the graph

source

pub fn has_vertex(&self, id: &PyAny) -> PyResult<bool>

Returns true if the graph contains the specified vertex

Arguments: id (str or int): the vertex id

Returns: true if the graph contains the specified vertex, false otherwise

source

pub fn has_edge( &self, src: &PyAny, dst: &PyAny, layer: Option<&str> ) -> PyResult<bool>

Returns true if the graph contains the specified edge

Arguments: src (str or int): the source vertex id dst (str or int): the destination vertex id
layer (str): the edge layer (optional)

Returns: true if the graph contains the specified edge, false otherwise

source

pub fn vertex(&self, id: &PyAny) -> PyResult<Option<PyVertex>>

Gets the vertex with the specified id

Arguments: id (str or int): the vertex id

Returns: the vertex with the specified id, or None if the vertex does not exist

source

pub fn vertices(&self) -> PyVertices

Gets the vertices in the graph

Returns: the vertices in the graph

source

pub fn edge( &self, src: &PyAny, dst: &PyAny, layer: Option<&str> ) -> PyResult<Option<PyEdge>>

Gets the edge with the specified source and destination vertices

Arguments: src (str or int): the source vertex id dst (str or int): the destination vertex id layer (str): the edge layer (optional)

Returns: the edge with the specified source and destination vertices, or None if the edge does not exist

source

pub fn edges(&self) -> PyEdges

Gets all edges in the graph

Returns: the edges in the graph

source

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

Returns the default start time for perspectives over the view

Returns: the default start time for perspectives over the view

source

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

Returns the default start datetime for perspectives over the view

Returns: the default start datetime for perspectives over the view

source

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

Returns the default end time for perspectives over the view

Returns: the default end time for perspectives over the view

source

pub fn window_size(&self) -> Option<u64>

Returns the size of the window covered by this view

Returns: int: the size of the window

source

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

Returns the default end datetime for perspectives over the view

Returns: the default end datetime for perspectives over the view

source

pub fn window( &self, start: Option<&PyAny>, end: Option<&PyAny> ) -> PyResult<PyGraphView>

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

Arguments: start (int): the start time of the window (optional) end (int): the end time of the window (optional)

Returns: a view including all events between t_start (inclusive) and t_end (exclusive)

source

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

Create a view including all events until end (inclusive)

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

Returns: a view including all events until end (inclusive)

source

pub fn default_layer(&self) -> PyGraphView

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

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 __repr__(&self) -> String

Displays the graph

Trait Implementations§

source§

impl<G: GraphViewOps + IntoDynamic> From<G> for PyGraphView

Graph view is a read-only version of a graph at a certain point in time.

source§

fn from(value: G) -> Self

Converts to this type from the input type.
source§

impl IntoPy<Py<PyAny>> for PyGraphView

source§

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

Performs the conversion.
source§

impl PyClass for PyGraphView

§

type Frozen = True

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for PyGraphView

source§

const DOC: &'static str = _

Class doc string
source§

const IS_BASETYPE: bool = true

#[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<PyGraphView>

Layout
§

type BaseType = PyAny

Base class
§

type ThreadChecker = ThreadCheckerStub<PyGraphView>

This handles following two situations: Read more
§

type Inventory = Pyo3MethodsInventoryForPyGraphView

§

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

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 PyGraphView

§

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

source§

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

source§

impl PyTypeInfo for PyGraphView

§

type AsRefTarget = PyCell<PyGraphView>

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 PyGraphView

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