Skip to main content

PyGraphRecord

Struct PyGraphRecord 

Source
pub struct PyGraphRecord { /* private fields */ }

Implementations§

Source§

impl PyGraphRecord

Source

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.

Source

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

Source

pub fn new() -> Self

Source

pub fn _to_bytes<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyBytes>>

Source

pub fn _from_bytes(data: &Bound<'_, PyBytes>) -> PyResult<Self>

Source

pub fn with_schema(schema: PySchema) -> Self

Source

pub fn with_plugins(plugins: HashMap<PyPluginName, Py<PyAny>>) -> PyResult<Self>

Source

pub fn from_tuples( nodes: Vec<(PyNodeIndex, PyAttributes)>, edges: Option<Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>>, schema: Option<PySchema>, ) -> PyResult<Self>

Source

pub fn from_dataframes( nodes_dataframes: Vec<(PyDataFrame, String)>, edges_dataframes: Vec<(PyDataFrame, String, String)>, schema: Option<PySchema>, ) -> PyResult<Self>

Source

pub fn from_nodes_dataframes( nodes_dataframes: Vec<(PyDataFrame, String)>, schema: Option<PySchema>, ) -> PyResult<Self>

Source

pub fn from_ron(path: &str) -> PyResult<Self>

Source

pub fn with_connector(connector: Py<PyAny>) -> PyResult<Self>

Source

pub fn to_ron(&self, path: &str) -> PyResult<()>

Source

pub fn to_dataframes(&self, py: Python<'_>) -> PyResult<Py<PyAny>>

Source

pub fn disconnect(&self) -> PyResult<Self>

Source

pub fn ingest(&self, data: Py<PyAny>) -> PyResult<()>

Source

pub fn export(&self) -> PyResult<Py<PyAny>>

Source

pub fn add_plugin(&self, name: PyPluginName, plugin: Py<PyAny>) -> PyResult<()>

Source

pub fn remove_plugin(&self, name: PyPluginName) -> PyResult<()>

Source

pub fn plugins(&self) -> PyResult<Vec<PyPluginName>>

Source

pub fn get_schema(&self) -> PyResult<PySchema>

Source

pub fn set_schema(&self, schema: PySchema, bypass_plugins: bool) -> PyResult<()>

Source

pub fn freeze_schema(&self, bypass_plugins: bool) -> PyResult<()>

Source

pub fn unfreeze_schema(&self, bypass_plugins: bool) -> PyResult<()>

Source

pub fn nodes(&self) -> PyResult<Vec<PyNodeIndex>>

Source

pub fn node( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, PyAttributes>>

Source

pub fn edges(&self) -> PyResult<Vec<EdgeIndex>>

Source

pub fn edge( &self, edge_index: Vec<EdgeIndex>, ) -> PyResult<HashMap<EdgeIndex, PyAttributes>>

Source

pub fn groups(&self) -> PyResult<Vec<PyGroup>>

Source

pub fn outgoing_edges( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<EdgeIndex>>>

Source

pub fn incoming_edges( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<EdgeIndex>>>

Source

pub fn edge_endpoints( &self, edge_index: Vec<EdgeIndex>, ) -> PyResult<HashMap<EdgeIndex, (PyNodeIndex, PyNodeIndex)>>

Source

pub fn edges_connecting( &self, source_node_indices: Vec<PyNodeIndex>, target_node_indices: Vec<PyNodeIndex>, ) -> PyResult<Vec<EdgeIndex>>

Source

pub fn edges_connecting_undirected( &self, first_node_indices: Vec<PyNodeIndex>, second_node_indices: Vec<PyNodeIndex>, ) -> PyResult<Vec<EdgeIndex>>

Source

pub fn remove_nodes( &self, node_indices: Vec<PyNodeIndex>, bypass_plugins: bool, ) -> PyResult<HashMap<PyNodeIndex, PyAttributes>>

Source

pub fn replace_node_attributes( &self, node_indices: Vec<PyNodeIndex>, attributes: PyAttributes, ) -> PyResult<()>

Source

pub fn update_node_attribute( &self, node_indices: Vec<PyNodeIndex>, attribute: PyGraphRecordAttribute, value: PyGraphRecordValue, ) -> PyResult<()>

Source

pub fn remove_node_attribute( &self, node_indices: Vec<PyNodeIndex>, attribute: PyGraphRecordAttribute, ) -> PyResult<()>

Source

pub fn add_nodes( &self, nodes: Vec<(PyNodeIndex, PyAttributes)>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn add_nodes_with_group( &self, nodes: Vec<(PyNodeIndex, PyAttributes)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn add_nodes_dataframes( &self, nodes_dataframes: Vec<(PyDataFrame, String)>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn add_nodes_dataframes_with_group( &self, nodes_dataframes: Vec<(PyDataFrame, String)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn remove_edges( &self, edge_indices: Vec<EdgeIndex>, bypass_plugins: bool, ) -> PyResult<HashMap<EdgeIndex, PyAttributes>>

Source

pub fn replace_edge_attributes( &self, edge_indices: Vec<EdgeIndex>, attributes: PyAttributes, ) -> PyResult<()>

Source

pub fn update_edge_attribute( &self, edge_indices: Vec<EdgeIndex>, attribute: PyGraphRecordAttribute, value: PyGraphRecordValue, ) -> PyResult<()>

Source

pub fn remove_edge_attribute( &self, edge_indices: Vec<EdgeIndex>, attribute: PyGraphRecordAttribute, ) -> PyResult<()>

Source

pub fn add_edges( &self, relations: Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>

Source

pub fn add_edges_with_group( &self, relations: Vec<(PyNodeIndex, PyNodeIndex, PyAttributes)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>

Source

pub fn add_edges_dataframes( &self, edges_dataframes: Vec<(PyDataFrame, String, String)>, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>

Source

pub fn add_edges_dataframes_with_group( &self, edges_dataframes: Vec<(PyDataFrame, String, String)>, group: PyGroup, bypass_plugins: bool, ) -> PyResult<Vec<EdgeIndex>>

Source

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<()>

Source

pub fn remove_groups( &self, group: Vec<PyGroup>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn add_nodes_to_group( &self, group: PyGroup, node_index: Vec<PyNodeIndex>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn add_edges_to_group( &self, group: PyGroup, edge_index: Vec<EdgeIndex>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn remove_nodes_from_group( &self, group: PyGroup, node_index: Vec<PyNodeIndex>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn remove_edges_from_group( &self, group: PyGroup, edge_index: Vec<EdgeIndex>, bypass_plugins: bool, ) -> PyResult<()>

Source

pub fn nodes_in_group( &self, group: Vec<PyGroup>, ) -> PyResult<HashMap<PyGroup, Vec<PyNodeIndex>>>

Source

pub fn ungrouped_nodes(&self) -> PyResult<Vec<PyNodeIndex>>

Source

pub fn edges_in_group( &self, group: Vec<PyGroup>, ) -> PyResult<HashMap<PyGroup, Vec<EdgeIndex>>>

Source

pub fn ungrouped_edges(&self) -> PyResult<Vec<EdgeIndex>>

Source

pub fn groups_of_node( &self, node_index: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyGroup>>>

Source

pub fn groups_of_edge( &self, edge_index: Vec<EdgeIndex>, ) -> PyResult<HashMap<EdgeIndex, Vec<PyGroup>>>

Source

pub fn node_count(&self) -> PyResult<usize>

Source

pub fn edge_count(&self) -> PyResult<usize>

Source

pub fn group_count(&self) -> PyResult<usize>

Source

pub fn contains_node(&self, node_index: PyNodeIndex) -> PyResult<bool>

Source

pub fn contains_edge(&self, edge_index: EdgeIndex) -> PyResult<bool>

Source

pub fn contains_group(&self, group: PyGroup) -> PyResult<bool>

Source

pub fn neighbors_outgoing( &self, node_indices: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyNodeIndex>>>

Source

pub fn neighbors_incoming( &self, node_indices: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyNodeIndex>>>

Source

pub fn neighbors_undirected( &self, node_indices: Vec<PyNodeIndex>, ) -> PyResult<HashMap<PyNodeIndex, Vec<PyNodeIndex>>>

Source

pub fn clear(&self, bypass_plugins: bool) -> PyResult<()>

Source

pub fn query_nodes( &self, py: Python<'_>, query: &Bound<'_, PyFunction>, ) -> PyResult<Py<PyAny>>

§Panics

Panics if the python typing was not followed.

Source

pub fn query_edges( &self, py: Python<'_>, query: &Bound<'_, PyFunction>, ) -> PyResult<Py<PyAny>>

§Panics

Panics if the python typing was not followed.

Source

pub fn clone(&self) -> Self

Source

pub fn overview(&self, truncate_details: Option<usize>) -> PyResult<PyOverview>

Source

pub fn group_overview( &self, group: PyGroup, truncate_details: Option<usize>, ) -> PyResult<PyGroupOverview>

Trait Implementations§

Source§

impl Clone for PyGraphRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PyGraphRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<ConnectedGraphRecord<PyConnector>> for PyGraphRecord

Source§

fn from(value: ConnectedGraphRecord<PyConnector>) -> Self

Converts to this type from the input type.
Source§

impl From<GraphRecord> for PyGraphRecord

Source§

fn from(value: GraphRecord) -> Self

Converts to this type from the input type.
Source§

impl<'py> IntoPyObject<'py> for PyGraphRecord

Source§

type Target = PyGraphRecord

The Python output type
Source§

type Output = Bound<'py, <PyGraphRecord as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>

Performs the conversion.
Source§

impl PyClass for PyGraphRecord

Source§

type Frozen = True

Whether the pyclass is frozen. Read more
Source§

impl PyClassImpl for PyGraphRecord

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)]
Source§

const IS_IMMUTABLE_TYPE: bool = false

#[pyclass(immutable_type)]
Source§

const RAW_DOC: &'static CStr = c"\x00"

Docstring for the class provided on the struct or enum. Read more
Source§

const DOC: &'static CStr

Fully rendered class doc, including the text_signature if a constructor is defined. Read more
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = SendablePyClass<PyGraphRecord>

This handles following two situations: Read more
Source§

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

Immutable or mutable
Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

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 PyClassNewTextSignature for PyGraphRecord

Source§

const TEXT_SIGNATURE: &'static str = "()"

Source§

impl PyMethods<PyGraphRecord> for PyClassImplCollector<PyGraphRecord>

Source§

fn py_methods(self) -> &'static PyClassItems

Source§

impl PyTypeInfo for PyGraphRecord

Source§

const NAME: &'static str = "PyGraphRecord"

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<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
Source§

fn is_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
Source§

fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
Source§

impl TryFrom<PyGraphRecord> for GraphRecord

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(value: PyGraphRecord) -> PyResult<Self>

Performs the conversion.
Source§

impl DerefToPyAny for PyGraphRecord

Source§

impl ExtractPyClassWithClone for PyGraphRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, F> DeepInto<T> for F
where T: DeepFrom<F>,

Source§

fn deep_into(self) -> T

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, 'py, T> FromPyObject<'a, 'py> for T
where T: PyClass + Clone + ExtractPyClassWithClone,

Source§

type Error = PyClassGuardError<'a, 'py>

The type returned in the event of a conversion error. Read more
Source§

fn extract( obj: Borrowed<'a, 'py, PyAny>, ) -> Result<T, <T as FromPyObject<'a, 'py>>::Error>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

Source§

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§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
Source§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
Source§

impl<T> Key for T
where T: Clone,

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

Source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
Source§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

Source§

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.
Source§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
Source§

fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>

Returns the expected type as a possible argument for the isinstance and issubclass function. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<'py, T> FromPyObjectOwned<'py> for T
where T: for<'a> FromPyObject<'a, 'py>,

Source§

impl<T> Ungil for T
where T: Send,