pub struct PyGraphRecord { /* private fields */ }Implementations§
Source§impl PyGraphRecord
impl PyGraphRecord
Sourcepub fn scope<R>(
py: Python<'_>,
graphrecord: &GraphRecord,
function: impl FnOnce(Python<'_>, &Py<Self>) -> GraphRecordResult<R>,
) -> GraphRecordResult<R>
pub fn scope<R>( py: Python<'_>, graphrecord: &GraphRecord, function: impl FnOnce(Python<'_>, &Py<Self>) -> GraphRecordResult<R>, ) -> GraphRecordResult<R>
Safely pass a &GraphRecord to Python as a read-only PyGraphRecord for the
duration of the callback. The pointer is invalidated when function returns.
The resulting PyGraphRecord will reject any mutation attempts with a runtime
error. See Self::scope_mut for the read-write variant.
Sourcepub fn scope_mut<R>(
py: Python<'_>,
graphrecord: &mut GraphRecord,
function: impl FnOnce(Python<'_>, &Py<Self>) -> GraphRecordResult<R>,
) -> GraphRecordResult<R>
pub fn scope_mut<R>( py: Python<'_>, graphrecord: &mut GraphRecord, function: impl FnOnce(Python<'_>, &Py<Self>) -> GraphRecordResult<R>, ) -> GraphRecordResult<R>
Safely pass a &mut GraphRecord to Python as a PyGraphRecord for the
duration of the callback. The pointer is invalidated when function returns.
The resulting PyGraphRecord allows both reads and mutations. See Self::scope
for the read-only variant.
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: HashMap<PyPluginName, Py<PyAny>>) -> PyResult<Self>
pub fn from_tuples( nodes: Vec<(PyNodeIndex, PyAttributes)>, edges: Option<Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>>, schema: Option<PySchema>, ) -> PyResult<Self>
pub fn from_dataframes( nodes_dataframes: Vec<(PyDataFrame, String)>, edges_dataframes: Vec<(PyDataFrame, String, String)>, schema: Option<PySchema>, ) -> PyResult<Self>
pub fn from_nodes_dataframes( nodes_dataframes: Vec<(PyDataFrame, String)>, schema: Option<PySchema>, ) -> PyResult<Self>
pub fn from_ron(path: &str) -> PyResult<Self>
pub fn with_connector(connector: Py<PyAny>) -> PyResult<Self>
pub fn to_ron(&self, path: &str) -> PyResult<()>
pub fn to_dataframes(&self, py: Python<'_>) -> PyResult<Py<PyAny>>
pub fn disconnect(&self) -> PyResult<Self>
pub fn ingest(&self, data: Py<PyAny>) -> PyResult<()>
pub fn export(&self) -> PyResult<Py<PyAny>>
pub fn add_plugin(&self, name: PyPluginName, plugin: Py<PyAny>) -> PyResult<()>
pub fn remove_plugin(&self, name: PyPluginName) -> PyResult<()>
pub fn plugins(&self) -> PyResult<Vec<PyPluginName>>
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_outgoing( &self, node_indices: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyNodeIndex>>>
pub fn neighbors_incoming( &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<ConnectedGraphRecord<PyConnector>> for PyGraphRecord
impl From<ConnectedGraphRecord<PyConnector>> for PyGraphRecord
Source§fn from(value: ConnectedGraphRecord<PyConnector>) -> Self
fn from(value: ConnectedGraphRecord<PyConnector>) -> Self
Source§impl From<GraphRecord> for PyGraphRecord
impl From<GraphRecord> for PyGraphRecord
Source§fn from(value: GraphRecord) -> Self
fn from(value: GraphRecord) -> Self
Source§impl<'py> IntoPyObject<'py> for PyGraphRecord
impl<'py> IntoPyObject<'py> for PyGraphRecord
Source§type Target = PyGraphRecord
type Target = PyGraphRecord
Source§type Output = Bound<'py, <PyGraphRecord as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyGraphRecord as IntoPyObject<'py>>::Target>
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>
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
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
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = c"\x00"
const RAW_DOC: &'static CStr = c"\x00"
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PyGraphRecord>
type ThreadChecker = SendablePyClass<PyGraphRecord>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Source§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 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
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
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
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> ⓘ
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> ⓘ
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>
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
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.