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§fn clone(&self) -> CustomData
fn clone(&self) -> CustomData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CustomData
impl Debug 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<'py> IntoPyObject<'py> for CustomData
impl<'py> IntoPyObject<'py> for CustomData
Source§type Target = CustomData
type Target = CustomData
Source§type Output = Bound<'py, <CustomData as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <CustomData 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 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 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 = /// 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).
Source§const DOC: &'static CStr
const DOC: &'static CStr
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>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForCustomData
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
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>
Source§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Source§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
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
Source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
Source§impl PyTypeInfo for CustomData
impl PyTypeInfo for CustomData
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
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 Serialize for CustomData
impl Serialize for CustomData
impl DerefToPyAny for CustomData
Auto Trait Implementations§
impl Freeze for CustomData
impl !RefUnwindSafe for CustomData
impl Send for CustomData
impl Sync for CustomData
impl Unpin for CustomData
impl UnsafeUnpin for CustomData
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
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.