Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied
- --> src/bin/main.rs:66:45
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^ ------- help: remove this lifetime argument
- | |
- | expected 0 lifetime arguments
- |
- note: trait defined here, with 0 lifetime parameters
- --> /home/holo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-async-1.0.0/src/i2c.rs:25:11
- |
- 25 | pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
- | ^^^
- error[E0107]: trait takes at most 1 generic argument but 2 generic arguments were supplied
- --> src/bin/main.rs:66:45
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^ ----- help: remove this generic argument
- | |
- | expected at most 1 generic argument
- |
- note: trait defined here, with at most 1 generic parameter: `A`
- --> /home/holo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-async-1.0.0/src/i2c.rs:25:11
- |
- 25 | pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
- | ^^^ --------------------------------
- error[E0191]: the value of the associated type `Error` in `embedded_hal::i2c::ErrorType` must be specified
- --> src/bin/main.rs:66:45
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated type: `I2c<'static, I2C1, Async, Error = Type>`
- error[E0038]: the trait `embedded_hal_async::i2c::I2c` cannot be made into an object
- --> src/bin/main.rs:66:35
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `embedded_hal_async::i2c::I2c` cannot be made into an object
- |
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> /home/holo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-async-1.0.0/src/i2c.rs:45:14
- |
- 45 | async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error> {
- | ^^^^ the trait cannot be made into an object because method `read` is `async`
- ...
- 67 | async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error> {
- | ^^^^^ the trait cannot be made into an object because method `write` is `async`
- ...
- 95 | async fn write_read(
- | ^^^^^^^^^^ the trait cannot be made into an object because method `write_read` is `async`
- ...
- 121 | async fn transaction(
- | ^^^^^^^^^^^ the trait cannot be made into an object because method `transaction` is `async`
- = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `embedded_hal_async::i2c::I2c` for this new enum and using it instead:
- &mut T
- embassy_rp::i2c::I2c<'d, T, embassy_rp::i2c::Async>
- embassy_embedded_hal::adapter::yielding_async::YieldingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice<'_, M, BUS>
- embassy_embedded_hal::adapter::blocking_async::BlockingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDeviceWithConfig<'_, M, BUS>
- note: required by a bound in `SDC41`
- --> /home/holo/workspace/embeded/scd41-embassy-rs/src/sdc41.rs:10:8
- |
- 8 | pub struct SDC41<T>
- | ----- required by a bound in this struct
- 9 | where
- 10 | T: I2c<SevenBitAddress>,
- | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `SDC41`
- error[E0038]: the trait `embedded_hal_async::i2c::I2c` cannot be made into an object
- --> src/bin/main.rs:66:41
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `embedded_hal_async::i2c::I2c` cannot be made into an object
- |
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> /home/holo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-async-1.0.0/src/i2c.rs:45:14
- |
- 45 | async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error> {
- | ^^^^ the trait cannot be made into an object because method `read` is `async`
- ...
- 67 | async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error> {
- | ^^^^^ the trait cannot be made into an object because method `write` is `async`
- ...
- 95 | async fn write_read(
- | ^^^^^^^^^^ the trait cannot be made into an object because method `write_read` is `async`
- ...
- 121 | async fn transaction(
- | ^^^^^^^^^^^ the trait cannot be made into an object because method `transaction` is `async`
- = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `embedded_hal_async::i2c::I2c` for this new enum and using it instead:
- &mut T
- embassy_rp::i2c::I2c<'d, T, embassy_rp::i2c::Async>
- embassy_embedded_hal::adapter::yielding_async::YieldingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice<'_, M, BUS>
- embassy_embedded_hal::adapter::blocking_async::BlockingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDeviceWithConfig<'_, M, BUS>
- error[E0277]: the size for values of type `(dyn embedded_hal_async::i2c::I2c + 'static)` cannot be known at compilation time
- --> src/bin/main.rs:66:35
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `(dyn embedded_hal_async::i2c::I2c + 'static)`
- note: required by a bound in `SDC41`
- --> /home/holo/workspace/embeded/scd41-embassy-rs/src/sdc41.rs:8:18
- |
- 8 | pub struct SDC41<T>
- | ^ required by this bound in `SDC41`
- error[E0609]: no field `measurments` on type `SDC41<dyn embedded_hal_async::i2c::I2c>`
- --> src/bin/main.rs:67:12
- |
- 67 | sensor.measurments.await
- | ^^^^^^^^^^^ unknown field
- error[E0038]: the trait `embedded_hal_async::i2c::I2c` cannot be made into an object
- --> src/bin/main.rs:66:27
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^ `embedded_hal_async::i2c::I2c` cannot be made into an object
- |
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> /home/holo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-async-1.0.0/src/i2c.rs:45:14
- |
- 45 | async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error> {
- | ^^^^ the trait cannot be made into an object because method `read` is `async`
- ...
- 67 | async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error> {
- | ^^^^^ the trait cannot be made into an object because method `write` is `async`
- ...
- 95 | async fn write_read(
- | ^^^^^^^^^^ the trait cannot be made into an object because method `write_read` is `async`
- ...
- 121 | async fn transaction(
- | ^^^^^^^^^^^ the trait cannot be made into an object because method `transaction` is `async`
- = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `embedded_hal_async::i2c::I2c` for this new enum and using it instead:
- &mut T
- embassy_rp::i2c::I2c<'d, T, embassy_rp::i2c::Async>
- embassy_embedded_hal::adapter::yielding_async::YieldingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice<'_, M, BUS>
- embassy_embedded_hal::adapter::blocking_async::BlockingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDeviceWithConfig<'_, M, BUS>
- note: required by a bound in `SDC41`
- --> /home/holo/workspace/embeded/scd41-embassy-rs/src/sdc41.rs:10:8
- |
- 8 | pub struct SDC41<T>
- | ----- required by a bound in this struct
- 9 | where
- 10 | T: I2c<SevenBitAddress>,
- | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `SDC41`
- error[E0038]: the trait `embedded_hal_async::i2c::I2c` cannot be made into an object
- --> src/bin/main.rs:66:27
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^ `embedded_hal_async::i2c::I2c` cannot be made into an object
- |
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> /home/holo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-async-1.0.0/src/i2c.rs:45:14
- |
- 45 | async fn read(&mut self, address: A, read: &mut [u8]) -> Result<(), Self::Error> {
- | ^^^^ the trait cannot be made into an object because method `read` is `async`
- ...
- 67 | async fn write(&mut self, address: A, write: &[u8]) -> Result<(), Self::Error> {
- | ^^^^^ the trait cannot be made into an object because method `write` is `async`
- ...
- 95 | async fn write_read(
- | ^^^^^^^^^^ the trait cannot be made into an object because method `write_read` is `async`
- ...
- 121 | async fn transaction(
- | ^^^^^^^^^^^ the trait cannot be made into an object because method `transaction` is `async`
- = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `embedded_hal_async::i2c::I2c` for this new enum and using it instead:
- &mut T
- embassy_rp::i2c::I2c<'d, T, embassy_rp::i2c::Async>
- embassy_embedded_hal::adapter::yielding_async::YieldingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice<'_, M, BUS>
- embassy_embedded_hal::adapter::blocking_async::BlockingAsync<T>
- embassy_embedded_hal::shared_bus::asynch::i2c::I2cDeviceWithConfig<'_, M, BUS>
- error[E0277]: the size for values of type `(dyn embedded_hal_async::i2c::I2c + 'static)` cannot be known at compilation time
- --> src/bin/main.rs:66:27
- |
- 66 | async fn measurments_task(sensor: SDC41<dyn I2c<'static, I2C1, Async>>) -> ! {
- | ^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `(dyn embedded_hal_async::i2c::I2c + 'static)`
- note: required by a bound in `SDC41`
- --> /home/holo/workspace/embeded/scd41-embassy-rs/src/sdc41.rs:8:18
- |
- 8 | pub struct SDC41<T>
- | ^ required by this bound in `SDC41`
Advertisement
Add Comment
Please, Sign In to add comment