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
impl PyEdge
PyEdge is a Python class that represents an edge in the graph. An edge is a directed connection between two vertices.
pub fn __getitem__(&self, name: String) -> Option<Prop>
sourcepub fn property(
&self,
name: String,
include_static: Option<bool>
) -> Option<Prop>
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.
sourcepub fn property_history(&self, name: String) -> Vec<(i64, Prop)>
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.
sourcepub fn history(&self) -> Vec<i64>
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.
sourcepub fn properties(&self, include_static: Option<bool>) -> HashMap<String, Prop>
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.
sourcepub fn property_histories(&self) -> HashMap<String, Vec<(i64, Prop)>>
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.
sourcepub fn property_names(&self, include_static: Option<bool>) -> Vec<String>
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.
sourcepub fn has_property(&self, name: String, include_static: Option<bool>) -> bool
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.
sourcepub fn has_static_property(&self, name: String) -> bool
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.
pub fn static_property(&self, name: String) -> Option<Prop>
sourcepub fn start(&self) -> Option<i64>
pub fn start(&self) -> Option<i64>
Get the start time of the Edge.
Returns: The start time of the Edge.
sourcepub fn start_date_time(&self) -> Option<NaiveDateTime>
pub fn start_date_time(&self) -> Option<NaiveDateTime>
Get the start datetime of the Edge.
Returns: the start datetime of the Edge.
sourcepub fn end(&self) -> Option<i64>
pub fn end(&self) -> Option<i64>
Get the end time of the Edge.
Returns: The end time of the Edge.
sourcepub fn end_date_time(&self) -> Option<NaiveDateTime>
pub fn end_date_time(&self) -> Option<NaiveDateTime>
Get the end datetime of the Edge.
Returns: The end datetime of the Edge
sourcepub fn window(
&self,
t_start: Option<&PyAny>,
t_end: Option<&PyAny>
) -> PyResult<PyEdge>
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.
sourcepub fn at(&self, end: &PyAny) -> PyResult<PyEdge>
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.
sourcepub fn explode(&self) -> PyEdges
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
sourcepub fn earliest_time(&self) -> Option<i64>
pub fn earliest_time(&self) -> Option<i64>
Gets the earliest time of an edge.
Returns: (int) The earliest time of an edge
sourcepub fn earliest_date_time(&self) -> Option<NaiveDateTime>
pub fn earliest_date_time(&self) -> Option<NaiveDateTime>
Gets of earliest datetime of an edge.
Returns: the earliest datetime of an edge
sourcepub fn latest_time(&self) -> Option<i64>
pub fn latest_time(&self) -> Option<i64>
Gets the latest time of an edge.
Returns: (int) The latest time of an edge
sourcepub fn latest_date_time(&self) -> Option<NaiveDateTime>
pub fn latest_date_time(&self) -> Option<NaiveDateTime>
Gets of latest datetime of an edge.
Returns: the latest datetime of an edge
sourcepub fn time(&self) -> Option<i64>
pub fn time(&self) -> Option<i64>
Gets the time of an exploded edge.
Returns: (int) The time of an exploded edge
sourcepub fn layer_name(&self) -> String
pub fn layer_name(&self) -> String
Gets the name of the layer this edge belongs to
Returns: (str) The name of the layer
sourcepub fn date_time(&self) -> Option<NaiveDateTime>
pub fn date_time(&self) -> Option<NaiveDateTime>
Gets the datetime of an exploded edge.
Returns: (datetime) the datetime of an exploded edge
Trait Implementations§
source§impl PyClassImpl for PyEdge
impl PyClassImpl for PyEdge
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = ThreadCheckerStub<PyEdge>
type ThreadChecker = ThreadCheckerStub<PyEdge>
type Inventory = Pyo3MethodsInventoryForPyEdge
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl PyTypeInfo for PyEdge
impl PyTypeInfo for PyEdge
§type AsRefTarget = PyCell<PyEdge>
type AsRefTarget = PyCell<PyEdge>
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object is an instance of this type.