Trait 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§

Source

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§

Source

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].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PyStubType for &str

Source§

impl PyStubType for Cow<'_, str>

Source§

impl PyStubType for Cow<'_, OsStr>

Source§

impl PyStubType for Cow<'_, [u8]>

Source§

impl PyStubType for bool

Source§

impl PyStubType for char

Source§

impl PyStubType for f32

Source§

impl PyStubType for f64

Source§

impl PyStubType for i8

Source§

impl PyStubType for i16

Source§

impl PyStubType for i32

Source§

impl PyStubType for i64

Source§

impl PyStubType for i128

Source§

impl PyStubType for isize

Source§

impl PyStubType for u8

Source§

impl PyStubType for u16

Source§

impl PyStubType for u32

Source§

impl PyStubType for u64

Source§

impl PyStubType for u128

Source§

impl PyStubType for ()

Source§

impl PyStubType for usize

Source§

impl PyStubType for String

Source§

impl PyStubType for Duration

Source§

impl PyStubType for OsStr

Source§

impl PyStubType for OsString

Source§

impl PyStubType for PathBuf

Source§

impl PyStubType for SystemTime

Source§

impl PyStubType for NaiveDate

Source§

impl PyStubType for NaiveDateTime

Source§

impl PyStubType for NaiveTime

Source§

impl PyStubType for FixedOffset

Source§

impl PyStubType for Utc

Source§

impl PyStubType for Duration

Source§

impl PyStubType for Complex32

Source§

impl PyStubType for Complex64

Source§

impl PyStubType for CompareOp

Source§

impl PyStubType for PyAny

Source§

impl PyStubType for PyArithmeticError

Source§

impl PyStubType for PyArrayDescr

Source§

impl PyStubType for PyAssertionError

Source§

impl PyStubType for PyAttributeError

Source§

impl PyStubType for PyBackedBytes

Source§

impl PyStubType for PyBackedStr

Source§

impl PyStubType for PyBaseException

Source§

impl PyStubType for PyBlockingIOError

Source§

impl PyStubType for PyBrokenPipeError

Source§

impl PyStubType for PyBufferError

Source§

impl PyStubType for PyByteArray

Source§

impl PyStubType for PyBytes

Source§

impl PyStubType for PyBytesWarning

Source§

impl PyStubType for PyChildProcessError

Source§

impl PyStubType for PyConnectionAbortedError

Source§

impl PyStubType for PyConnectionError

Source§

impl PyStubType for PyConnectionRefusedError

Source§

impl PyStubType for PyConnectionResetError

Source§

impl PyStubType for PyDate

Source§

impl PyStubType for PyDateTime

Source§

impl PyStubType for PyDelta

Source§

impl PyStubType for PyDeprecationWarning

Source§

impl PyStubType for PyDict

Source§

impl PyStubType for PyEOFError

Source§

impl PyStubType for PyEncodingWarning

Source§

impl PyStubType for PyEnvironmentError

Source§

impl PyStubType for PyException

Source§

impl PyStubType for PyFileExistsError

Source§

impl PyStubType for PyFileNotFoundError

Source§

impl PyStubType for PyFloat

Source§

impl PyStubType for PyFloatingPointError

Source§

impl PyStubType for PyFutureWarning

Source§

impl PyStubType for PyGeneratorExit

Source§

impl PyStubType for PyIOError

Source§

impl PyStubType for PyImportError

Source§

impl PyStubType for PyImportWarning

Source§

impl PyStubType for PyIndexError

Source§

impl PyStubType for PyInt

Source§

impl PyStubType for PyInterruptedError

Source§

impl PyStubType for PyIsADirectoryError

Source§

impl PyStubType for PyKeyError

Source§

impl PyStubType for PyKeyboardInterrupt

Source§

impl PyStubType for PyList

Source§

impl PyStubType for PyLookupError

Source§

impl PyStubType for PyMemoryError

Source§

impl PyStubType for PyModuleNotFoundError

Source§

impl PyStubType for PyNameError

Source§

impl PyStubType for PyNotADirectoryError

Source§

impl PyStubType for PyNotImplementedError

Source§

impl PyStubType for PyOSError

Source§

impl PyStubType for PyOverflowError

Source§

impl PyStubType for PyPendingDeprecationWarning

Source§

impl PyStubType for PyPermissionError

Source§

impl PyStubType for PyProcessLookupError

Source§

impl PyStubType for PyRecursionError

Source§

impl PyStubType for PyReferenceError

Source§

impl PyStubType for PyResourceWarning

Source§

impl PyStubType for PyRuntimeError

Source§

impl PyStubType for PyRuntimeWarning

Source§

impl PyStubType for PySet

Source§

impl PyStubType for PySlice

Source§

impl PyStubType for PyStopAsyncIteration

Source§

impl PyStubType for PyStopIteration

Source§

impl PyStubType for PyString

Source§

impl PyStubType for PySyntaxError

Source§

impl PyStubType for PySyntaxWarning

Source§

impl PyStubType for PySystemError

Source§

impl PyStubType for PySystemExit

Source§

impl PyStubType for PyTime

Source§

impl PyStubType for PyTimeoutError

Source§

impl PyStubType for PyTuple

Source§

impl PyStubType for PyType

Source§

impl PyStubType for PyTypeError

Source§

impl PyStubType for PyTzInfo

Source§

impl PyStubType for PyUnboundLocalError

Source§

impl PyStubType for PyUnicodeDecodeError

Source§

impl PyStubType for PyUnicodeEncodeError

Source§

impl PyStubType for PyUnicodeError

Source§

impl PyStubType for PyUnicodeTranslateError

Source§

impl PyStubType for PyUnicodeWarning

Source§

impl PyStubType for PyUntypedArray

Source§

impl PyStubType for PyUserWarning

Source§

impl PyStubType for PyValueError

Source§

impl PyStubType for PyWarning

Source§

impl PyStubType for PyZeroDivisionError

Source§

impl<Key: PyStubType, Value: PyStubType> PyStubType for BTreeMap<Key, Value>

Source§

impl<Key: PyStubType, Value: PyStubType, State> PyStubType for HashMap<Key, Value, State>

Source§

impl<Key: PyStubType, Value: PyStubType, State> PyStubType for IndexMap<Key, Value, State>

Source§

impl<L: PyStubType, R: PyStubType> PyStubType for Either<L, R>

Source§

impl<T1: PyStubType> PyStubType for (T1,)

Source§

impl<T1: PyStubType, T2: PyStubType> PyStubType for (T1, T2)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType> PyStubType for (T1, T2, T3)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType, T4: PyStubType> PyStubType for (T1, T2, T3, T4)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType, T4: PyStubType, T5: PyStubType> PyStubType for (T1, T2, T3, T4, T5)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType, T4: PyStubType, T5: PyStubType, T6: PyStubType> PyStubType for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType, T4: PyStubType, T5: PyStubType, T6: PyStubType, T7: PyStubType> PyStubType for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType, T4: PyStubType, T5: PyStubType, T6: PyStubType, T7: PyStubType, T8: PyStubType> PyStubType for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1: PyStubType, T2: PyStubType, T3: PyStubType, T4: PyStubType, T5: PyStubType, T6: PyStubType, T7: PyStubType, T8: PyStubType, T9: PyStubType> PyStubType for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

impl<T, D> PyStubType for PyReadonlyArray<'_, T, D>
where T: NumPyScalar + Element, D: Dimension,

Source§

impl<T, D> PyStubType for PyReadwriteArray<'_, T, D>
where T: NumPyScalar + Element, D: Dimension,

Source§

impl<T: NumPyScalar, D> PyStubType for PyArray<T, D>

Source§

impl<T: PyStubType + PyClass> PyStubType for PyRef<'_, T>

Source§

impl<T: PyStubType + PyClass<Frozen = False>> PyStubType for PyRefMut<'_, T>

Source§

impl<T: PyStubType> PyStubType for Option<T>

Source§

impl<T: PyStubType> PyStubType for &T

Source§

impl<T: PyStubType> PyStubType for Box<T>

Source§

impl<T: PyStubType> PyStubType for BTreeSet<T>

Source§

impl<T: PyStubType> PyStubType for Rc<T>

Source§

impl<T: PyStubType> PyStubType for Arc<T>

Source§

impl<T: PyStubType> PyStubType for Vec<T>

Source§

impl<T: PyStubType> PyStubType for Bound<'_, T>

Source§

impl<T: PyStubType> PyStubType for IndexSet<T>

Source§

impl<T: PyStubType> PyStubType for Py<T>

Source§

impl<T: PyStubType, E> PyStubType for Result<T, E>

Source§

impl<T: PyStubType, State> PyStubType for HashSet<T, State>

Source§

impl<T: PyStubType, const N: usize> PyStubType for [T; N]

Source§

impl<Tz: TimeZone> PyStubType for DateTime<Tz>

Implementors§