You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's currently not possible to write a function generic over Twhere T is an inventory.
To rewrite the example given in the docs page:
fnprint_inventory<T: inventory::Collect>(){for flag in inventory::iter::<T>{println!("-{}, --{}", flag.short, flag.name);}}
This does already work, but the Collect trait is currently #[doc(hidden)]. My specific use case is doing the following, combined with two proc macros and a helper traits:
/// Allows arbitrary pymethod blocks to submit their methods, which are eventually collected by pyclasspubtraitPyMethodsInventory: inventory::Collect{/// Create a new instancefnnew(methods:&'static[PyMethodDefType]) -> Self;/// Returns the methods for a single impl blockfnget_methods(&self) -> &'static[PyMethodDefType];}
The text was updated successfully, but these errors were encountered:
It's currently not possible to write a function generic over
T
whereT
is an inventory.To rewrite the example given in the docs page:
This does already work, but the
Collect
trait is currently#[doc(hidden)]
. My specific use case is doing the following, combined with two proc macros and a helper traits:The text was updated successfully, but these errors were encountered: