Macro pyo3_stub_gen::impl_stub_type

source ยท
macro_rules! impl_stub_type {
    ($ty: ty = $($base:ty)|+) => { ... };
    ($ty:ty = $base:ty) => { ... };
}
Expand description

Implement PyStubType

use pyo3::*;
use pyo3_stub_gen::{impl_stub_type, derive::*};

#[gen_stub_pyclass]
#[pyclass]
struct A;

#[gen_stub_pyclass]
#[pyclass]
struct B;

enum E {
    A(A),
    B(B),
}
impl_stub_type!(E = A | B);

struct X(A);
impl_stub_type!(X = A);

struct Y {
   a: A,
   b: B,
}
impl_stub_type!(Y = (A, B));