Struct py_raphtory::edge::PyEdge

source ·
pub struct PyEdge { /* private fields */ }
Expand description

PyEdge is a Python class that represents an edge in the graph. An edge is a directed connection between two vertices.

Implementations§

source§

impl PyEdge

PyEdge is a Python class that represents an edge in the graph. An edge is a directed connection between two vertices.

source

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

source

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

Returns the value of the property with the given name. If the property is not found, None is returned. If the property is found, the value of the property is returned.

Arguments: name (str): The name of the property to retrieve.

Returns: The value of the property with the given name.

source

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

Returns the value of the property with the given name all times. If the property is not found, None is returned. If the property is found, the value of the property is returned.

Arguments: name (str): The name of the property to retrieve.

Returns: The value of the property with the given name.

source

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

Returns a list of timestamps of when an edge is added or change to an edge is made.

Returns: A list of timestamps.

source

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

Returns a dictionary of all properties on the edge.

Arguments: include_static (bool): Whether to include static properties in the result.

Returns: A dictionary of all properties on the edge.

source

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

Returns a dictionary of all properties on the edge at all times.

Returns: A dictionary of all properties on the edge at all times.

source

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

Returns a list of all property names on the edge.

Arguments: include_static (bool): Whether to include static properties in the result.

Returns: A list of all property names on the edge.

source

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

Check if a property exists with the given name.

Arguments: name (str): The name of the property to check. include_static (bool): Whether to include static properties in the result.

Returns: True if a property exists with the given name, False otherwise.

source

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

Check if a static property exists with the given name.

Arguments: name (str): The name of the property to check.

Returns: True if a static property exists with the given name, False otherwise.

source

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

source

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

Get the start time of the Edge.

Returns: The start time of the Edge.

source

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

Get the start datetime of the Edge.

Returns: the start datetime of the Edge.

source

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

Get the end time of the Edge.

Returns: The end time of the Edge.

source

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

Get the end datetime of the Edge.

Returns: The end datetime of the Edge

source

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

Get a new Edge with the properties of this Edge within the specified time window.

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

Returns: A new Edge with the properties of this Edge within the specified time window.

source

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

Get a new Edge with the properties of this Edge at a specified time.

Arguments: end (int): The time to get the properties at.

Returns: A new Edge with the properties of this Edge at a specified time.

source

pub fn explode(&self) -> PyEdges

Explodes an Edge into a list of PyEdges. This is useful when you want to iterate over the properties of an Edge at every single point in time. This will return a seperate edge each time a property had been changed.

Returns: A list of PyEdges

source

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

Gets the earliest time of an edge.

Returns: (int) The earliest time of an edge

source

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

Gets of earliest datetime of an edge.

Returns: the earliest datetime of an edge

source

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

Gets the latest time of an edge.

Returns: (int) The latest time of an edge

source

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

Gets of latest datetime of an edge.

Returns: the latest datetime of an edge

source

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

Gets the time of an exploded edge.

Returns: (int) The time of an exploded edge

source

pub fn layer_name(&self) -> String

Gets the name of the layer this edge belongs to

Returns: (str) The name of the layer

source

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

Gets the datetime of an exploded edge.

Returns: (datetime) the datetime of an exploded edge

source

pub fn __repr__(&self) -> String

Displays the Edge as a string.

Trait Implementations§

source§

impl<G: GraphViewOps + IntoDynamic> From<EdgeView<G>> for PyEdge

source§

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

Converts to this type from the input type.
source§

impl IntoPy<Py<PyAny>> for PyEdge

source§

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

Performs the conversion.
source§

impl PyClass for PyEdge

§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for PyEdge

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

Layout
§

type BaseType = PyAny

Base class
§

type ThreadChecker = ThreadCheckerStub<PyEdge>

This handles following two situations: Read more
§

type Inventory = Pyo3MethodsInventoryForPyEdge

§

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 PyEdge

§

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

source§

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

source§

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

§

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

source§

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

source§

impl PyTypeInfo for PyEdge

§

type AsRefTarget = PyCell<PyEdge>

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 PyEdge

source§

fn repr(&self) -> String

Auto Trait Implementations§

§

impl !RefUnwindSafe for PyEdge

§

impl Send for PyEdge

§

impl Sync for PyEdge

§

impl Unpin for PyEdge

§

impl !UnwindSafe for PyEdge

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,