pub struct CustomData {
pub data: Arc<dyn CustomDataTrait>,
pub data_type: DataType,
}Expand description
A wrapper for custom data including its data type.
The data field holds an Arc to a CustomDataTrait implementation,
enabling cheap cloning when passing to Python (Arc clone is O(1)).
Custom data is always Rust-defined (optionally with PyO3 bindings).
Fields§
§data: Arc<dyn CustomDataTrait>The actual data object implementing CustomDataTrait.
data_type: DataTypeThe data type metadata.
Implementations§
Source§impl CustomData
impl CustomData
Sourcepub fn from_arc(arc: Arc<dyn CustomDataTrait>) -> Self
pub fn from_arc(arc: Arc<dyn CustomDataTrait>) -> Self
Creates a new CustomData instance from an Arc’d CustomDataTrait,
deriving the data type from the inner type name.
Sourcepub fn new(data: Arc<dyn CustomDataTrait>, data_type: DataType) -> Self
pub fn new(data: Arc<dyn CustomDataTrait>, data_type: DataType) -> Self
Creates a new CustomData instance with explicit data type metadata.
Use this when the data type must come from external metadata (e.g. Parquet), rather than being derived from the inner type name.
Source§impl CustomData
impl CustomData
Trait Implementations§
Source§impl Clone for CustomData
impl Clone for CustomData
Source§impl Debug for CustomData
impl Debug for CustomData
impl DerefToPyAny for CustomData
Source§impl FromDataBatch for CustomData
impl FromDataBatch for CustomData
Source§impl<'a, 'py> FromPyObject<'a, 'py> for CustomDatawhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for CustomDatawhere
Self: Clone,
Source§impl HasTsInit for CustomData
impl HasTsInit for CustomData
Source§impl IntoDataBatch for CustomData
impl IntoDataBatch for CustomData
Source§impl<'py> IntoPyObject<'py> for CustomData
impl<'py> IntoPyObject<'py> for CustomData
Source§type Target = CustomData
type Target = CustomData
The Python output type
Source§type Output = Bound<'py, CustomData>
type Output = Bound<'py, CustomData>
The smart pointer type to use. Read more
Source§fn into_pyobject(self, py: Python<'py>) -> PyResult<Bound<'py, Self>>
fn into_pyobject(self, py: Python<'py>) -> PyResult<Bound<'py, Self>>
Performs the conversion.
Source§impl PartialEq for CustomData
impl PartialEq for CustomData
Source§impl PyClass for CustomData
impl PyClass for CustomData
Source§impl PyClassImpl for CustomData
impl PyClassImpl for CustomData
Source§const RAW_DOC: &'static CStr = /// A wrapper for custom data including its data type.
///
/// The `data` field holds an [`Arc`] to a [`CustomDataTrait`] implementation,
/// enabling cheap cloning when passing to Python (Arc clone is O(1)).
/// Custom data is always Rust-defined (optionally with PyO3 bindings).
const RAW_DOC: &'static CStr = /// A wrapper for custom data including its data type. /// /// The `data` field holds an [`Arc`] to a [`CustomDataTrait`] implementation, /// enabling cheap cloning when passing to Python (Arc clone is O(1)). /// Custom data is always Rust-defined (optionally with PyO3 bindings).
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 Layout = <<CustomData as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<CustomData>
type Layout = <<CustomData as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<CustomData>
Description of how this class is laid out in memory
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
This handles following two situations: Read more
type Inventory = Pyo3MethodsInventoryForCustomData
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
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 __traverse__(&self, visit: PyVisit<'_>) -> Result<(), PyTraverseError>
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Used to provide the dictoffset slot
(equivalent to tp_dictoffset)
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Used to provide the weaklistoffset slot
(equivalent to tp_weaklistoffset
Source§impl PyClassNewTextSignature for CustomData
impl PyClassNewTextSignature for CustomData
const TEXT_SIGNATURE: &'static str = "(data_type, data)"
Source§impl PyStubType for CustomData
impl PyStubType for CustomData
Source§fn type_output() -> TypeInfo
fn type_output() -> TypeInfo
The type to be used in the output signature, i.e. return type of the Python function or methods.
§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
The type to be used in the input signature, i.e. the arguments of the Python function or methods. Read more
Source§impl PyTypeInfo for CustomData
impl PyTypeInfo for CustomData
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.Auto Trait Implementations§
impl !RefUnwindSafe for CustomData
impl !UnwindSafe for CustomData
impl Freeze for CustomData
impl Send for CustomData
impl Sync for CustomData
impl Unpin for CustomData
impl UnsafeUnpin for CustomData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§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.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
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.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>where
Self: IntoPyObject<'py, Error = !>,
Converts
self into a [Py<PyAny>] when the underlying conversion is infallible.§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
Returns the expected type as a possible argument for the
isinstance and issubclass function. Read more