pub struct PyGraphRecord { /* private fields */ }Implementations§
Source§impl PyGraphRecord
impl PyGraphRecord
Sourcepub fn scope<R>(
py: Python<'_>,
graphrecord: &mut PluginGraphRecord,
function: impl FnOnce(Python<'_>, &Py<Self>) -> GraphRecordResult<R>,
) -> GraphRecordResult<R>
pub fn scope<R>( py: Python<'_>, graphrecord: &mut PluginGraphRecord, function: impl FnOnce(Python<'_>, &Py<Self>) -> GraphRecordResult<R>, ) -> GraphRecordResult<R>
Safely pass a &mut PluginGraphRecord to Python as a PyGraphRecord for the
duration of the callback. The pointer is invalidated when function returns.
Based on the discussion in:
Guard pattern adapted from:
Source§impl PyGraphRecord
impl PyGraphRecord
pub fn new() -> Self
pub fn _to_bytes<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyBytes>>
pub fn _from_bytes(data: &Bound<'_, PyBytes>) -> PyResult<Self>
pub fn with_schema(schema: PySchema) -> Self
pub fn with_plugins(plugins: Vec<Py<PyAny>>) -> PyResult<Self>
pub fn from_tuples( nodes: Vec<(PyNodeIndex, PyAttributes)>, edges: Option<Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>>, ) -> PyResult<Self>
pub fn from_dataframes( nodes_dataframes: Vec<(PyDataFrame, String)>, edges_dataframes: Vec<(PyDataFrame, String, String)>, ) -> PyResult<Self>
pub fn from_nodes_dataframes( nodes_dataframes: Vec<(PyDataFrame, String)>, ) -> PyResult<Self>
pub fn from_ron(path: &str) -> PyResult<Self>
pub fn to_ron(&self, path: &str) -> PyResult<()>
pub fn to_dataframes(&self, py: Python<'_>) -> PyResult<Py<PyAny>>
pub fn get_schema(&self) -> PyResult<PySchema>
pub fn set_schema(&self, schema: PySchema, bypass_plugins: bool) -> PyResult<()>
pub fn freeze_schema(&self, bypass_plugins: bool) -> PyResult<()>
pub fn unfreeze_schema(&self, bypass_plugins: bool) -> PyResult<()>
pub fn nodes(&self) -> PyResult<Vec<PyNodeIndex>>
pub fn node( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, PyAttributes>>
pub fn edges(&self) -> PyResult<Vec<EdgeIndex>>
pub fn edge( &self, edge_index: Vec<EdgeIndex>, ) -> PyResult<HashMap<EdgeIndex, PyAttributes>>
pub fn groups(&self) -> PyResult<Vec<PyGroup>>
pub fn outgoing_edges( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<EdgeIndex>>>
pub fn incoming_edges( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<EdgeIndex>>>
pub fn edge_endpoints( &self, edge_index: Vec<EdgeIndex>, ) -> PyResult<HashMap<EdgeIndex, (PyNodeIndex, PyNodeIndex)>>
pub fn edges_connecting( &self, source_node_indices: Vec<PyNodeIndex>, target_node_indices: Vec<PyNodeIndex>, ) -> PyResult<Vec<EdgeIndex>>
pub fn edges_connecting_undirected( &self, first_node_indices: Vec<PyNodeIndex>, second_node_indices: Vec<PyNodeIndex>, ) -> PyResult<Vec<EdgeIndex>>
pub fn remove_nodes( &self, node_indices: Vec<PyNodeIndex>, bypass_plugins: bool, ) -> PyResult<HashMap<PyNodeIndex, PyAttributes>>
pub fn replace_node_attributes( &self, node_indices: Vec<PyNodeIndex>, attributes: PyAttributes, ) -> PyResult<()>
pub fn update_node_attribute( &self, node_indices: Vec<PyNodeIndex>, attribute: PyGraphRecordAttribute, value: PyGraphRecordValue, ) -> PyResult<()>
pub fn remove_node_attribute( &self, node_indices: Vec<PyNodeIndex>, attribute: PyGraphRecordAttribute, ) -> PyResult<()>
pub fn add_nodes( &self, nodes: Vec<(PyNodeIndex, PyAttributes)>, bypass_plugins: bool, ) -> PyResult<()>
pub fn add_nodes_with_group( &self, nodes: Vec<(PyNodeIndex, PyAttributes)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<()>
pub fn add_nodes_dataframes( &self, nodes_dataframes: Vec<(PyDataFrame, String)>, bypass_plugins: bool, ) -> PyResult<()>
pub fn add_nodes_dataframes_with_group( &self, nodes_dataframes: Vec<(PyDataFrame, String)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<()>
pub fn remove_edges( &self, edge_indices: Vec<EdgeIndex>, bypass_plugins: bool, ) -> PyResult<HashMap<EdgeIndex, PyAttributes>>
pub fn replace_edge_attributes( &self, edge_indices: Vec<EdgeIndex>, attributes: PyAttributes, ) -> PyResult<()>
pub fn update_edge_attribute( &self, edge_indices: Vec<EdgeIndex>, attribute: PyGraphRecordAttribute, value: PyGraphRecordValue, ) -> PyResult<()>
pub fn remove_edge_attribute( &self, edge_indices: Vec<EdgeIndex>, attribute: PyGraphRecordAttribute, ) -> PyResult<()>
pub fn add_edges( &self, relations: Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>
pub fn add_edges_with_group( &self, relations: Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>
pub fn add_edges_dataframes( &self, edges_dataframes: Vec<(PyDataFrame, String, String)>, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>
pub fn add_edges_dataframes_with_group( &self, edges_dataframes: Vec<(PyDataFrame, String, String)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>
pub fn add_group( &self, group: PyGroup, node_indices_to_add: Option<Vec<PyNodeIndex>>, edge_indices_to_add: Option<Vec<EdgeIndex>>, bypass_plugins: bool, ) -> PyResult<()>
pub fn remove_groups( &self, group: Vec<PyGroup>, bypass_plugins: bool, ) -> PyResult<()>
pub fn add_nodes_to_group( &self, group: PyGroup, node_index: Vec<PyNodeIndex>, bypass_plugins: bool, ) -> PyResult<()>
pub fn add_edges_to_group( &self, group: PyGroup, edge_index: Vec<EdgeIndex>, bypass_plugins: bool, ) -> PyResult<()>
pub fn remove_nodes_from_group( &self, group: PyGroup, node_index: Vec<PyNodeIndex>, bypass_plugins: bool, ) -> PyResult<()>
pub fn remove_edges_from_group( &self, group: PyGroup, edge_index: Vec<EdgeIndex>, bypass_plugins: bool, ) -> PyResult<()>
pub fn nodes_in_group( &self, group: Vec<PyGroup>, ) -> PyResult<HashMap<PyGroup, Vec<PyNodeIndex>>>
pub fn ungrouped_nodes(&self) -> PyResult<Vec<PyNodeIndex>>
pub fn edges_in_group( &self, group: Vec<PyGroup>, ) -> PyResult<HashMap<PyGroup, Vec<EdgeIndex>>>
pub fn ungrouped_edges(&self) -> PyResult<Vec<EdgeIndex>>
pub fn groups_of_node( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyGroup>>>
pub fn groups_of_edge( &self, edge_index: Vec<EdgeIndex>, ) -> PyResult<HashMap<EdgeIndex, Vec<PyGroup>>>
pub fn node_count(&self) -> PyResult<usize>
pub fn edge_count(&self) -> PyResult<usize>
pub fn group_count(&self) -> PyResult<usize>
pub fn contains_node(&self, node_index: PyNodeIndex) -> PyResult<bool>
pub fn contains_edge(&self, edge_index: EdgeIndex) -> PyResult<bool>
pub fn contains_group(&self, group: PyGroup) -> PyResult<bool>
pub fn neighbors( &self, node_indices: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyNodeIndex>>>
pub fn neighbors_undirected( &self, node_indices: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyNodeIndex>>>
pub fn clear(&self, bypass_plugins: bool) -> PyResult<()>
Sourcepub fn query_nodes(
&self,
py: Python<'_>,
query: &Bound<'_, PyFunction>,
) -> PyResult<Py<PyAny>>
pub fn query_nodes( &self, py: Python<'_>, query: &Bound<'_, PyFunction>, ) -> PyResult<Py<PyAny>>
§Panics
Panics if the python typing was not followed.
Sourcepub fn query_edges(
&self,
py: Python<'_>,
query: &Bound<'_, PyFunction>,
) -> PyResult<Py<PyAny>>
pub fn query_edges( &self, py: Python<'_>, query: &Bound<'_, PyFunction>, ) -> PyResult<Py<PyAny>>
§Panics
Panics if the python typing was not followed.
pub fn clone(&self) -> Self
pub fn overview(&self, truncate_details: Option<usize>) -> PyResult<PyOverview>
pub fn group_overview( &self, group: PyGroup, truncate_details: Option<usize>, ) -> PyResult<PyGroupOverview>
Trait Implementations§
Source§impl Clone for PyGraphRecord
impl Clone for PyGraphRecord
Source§impl Debug for PyGraphRecord
impl Debug for PyGraphRecord
Source§impl From<GraphRecord> for PyGraphRecord
impl From<GraphRecord> for PyGraphRecord
Source§fn from(value: GraphRecord) -> Self
fn from(value: GraphRecord) -> Self
Converts to this type from the input type.
Source§impl From<PluginGraphRecord> for PyGraphRecord
impl From<PluginGraphRecord> for PyGraphRecord
Source§fn from(value: PluginGraphRecord) -> Self
fn from(value: PluginGraphRecord) -> Self
Converts to this type from the input type.
Source§impl<'py> IntoPyObject<'py> for PyGraphRecord
impl<'py> IntoPyObject<'py> for PyGraphRecord
Source§type Target = PyGraphRecord
type Target = PyGraphRecord
The Python output type
Source§type Output = Bound<'py, <PyGraphRecord as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyGraphRecord as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PyClass for PyGraphRecord
impl PyClass for PyGraphRecord
Source§impl PyClassImpl for PyGraphRecord
impl PyClassImpl for PyGraphRecord
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = c"\x00"
const RAW_DOC: &'static CStr = c"\x00"
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PyGraphRecord>
type ThreadChecker = SendablePyClass<PyGraphRecord>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
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 PyClassNewTextSignature for PyGraphRecord
impl PyClassNewTextSignature for PyGraphRecord
const TEXT_SIGNATURE: &'static str = "()"
Source§impl PyMethods<PyGraphRecord> for PyClassImplCollector<PyGraphRecord>
impl PyMethods<PyGraphRecord> for PyClassImplCollector<PyGraphRecord>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyGraphRecord
impl PyTypeInfo for PyGraphRecord
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
Source§impl TryFrom<PyGraphRecord> for GraphRecord
impl TryFrom<PyGraphRecord> for GraphRecord
impl DerefToPyAny for PyGraphRecord
impl ExtractPyClassWithClone for PyGraphRecord
Auto Trait Implementations§
impl !Freeze for PyGraphRecord
impl !RefUnwindSafe for PyGraphRecord
impl Send for PyGraphRecord
impl Sync for PyGraphRecord
impl Unpin for PyGraphRecord
impl UnsafeUnpin for PyGraphRecord
impl !UnwindSafe for PyGraphRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.Source§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
👎Deprecated since 0.27.0: Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Name of self. This is used in error messages, for example.