type_alias

Macro type_alias 

Source
macro_rules! type_alias {
    ($module:expr, $name:ident = $($base:ty)|+, $doc:expr) => { ... };
    ($module:expr, $name:ident = $($base:ty)|+) => { ... };
    ($module:expr, $name:ident = $ty:ty, $doc:expr) => { ... };
    ($module:expr, $name:ident = $ty:ty) => { ... };
}
Expand description

Add module-level type alias using TypeInfo

This macro supports both single types and union types.

§Examples

Single type:

pyo3_stub_gen::type_alias!("module.name", MyAlias = Option<usize>);

Union type (direct syntax):

pyo3_stub_gen::type_alias!("module.name", MyUnion = i32 | String);
pyo3_stub_gen::type_alias!("module.name", StructUnion = Bound<'static, TypeA> | Bound<'static, TypeB>);