Trait pyo3_stub_gen::stub_type::PyStubType
source · pub trait PyStubType {
// Required method
fn type_output() -> TypeInfo;
// Provided method
fn type_input() -> TypeInfo { ... }
}
Expand description
Annotate Rust types with Python type information.
Required Methods§
sourcefn 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.
Provided Methods§
sourcefn 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.
This defaults to the output type, but can be overridden for types that are not valid input types.
For example, Vec::<T>::type_output
returns list[T]
while Vec::<T>::type_input
returns typing.Sequence[T]
.
Object Safety§
This trait is not object safe.