-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WithPwm trait should be public #425
Comments
Yeah. Generic code with sealed trait is often problematic. stm32f1xx-hal/src/timer/hal_02.rs Line 136 in f9b24f4
|
To use PwmPin I have to add the trait bound |
I think we should move methods from trait PWM {
fn enable() ...
fn disable()....
fn get_duty()....
....
}
impl<TIM, REMAP, P, PINS> PWM for PwmHz<TIM, REMAP, P, PINS> where ... {
...
}
impl<TIM, REMAP, P, PINS> PWM for Pwm<TIM, REMAP, P, PINS> where ... {
....
} |
I writing a generic struct that takes a pwm channel to control a motor.
We've tried this code:
And I get the following error:
The ideal resolution would be to add trait bound with
WithPwm
trait, but it's impossible as it's a sealed trait.Shouldn't it be public in order write this trait bound ? If this isn't the case, how should I resolve ?
The text was updated successfully, but these errors were encountered: