Joylei / eip-rs

rseip - EIP&CIP client in pure Rust, for generic CIP and AB PLC
MIT License
47 stars 6 forks source link

Bytes #14

Closed wotori closed 1 year ago

wotori commented 1 year ago

How to use type bytes?

let value: TagValue<Bytes> = client.read_tag(tag).await?;

error[E0412]: cannot find type `Bytes` in this scope
  --> src/main.rs:12:25
   |
12 |     let value: TagValue<Bytes> = client.read_tag(tag.clone()).await?;
   |                         ^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  | use core::str::Bytes;
   |
1  | use std::io::Bytes;
   |
1  | use std::str::Bytes;
   |

I have tried all imports suggested by the compiler but did not succeed

Joylei commented 1 year ago

you need to add bytes to your Cargo.toml

bytes = "1"

Then you have byte::Bytes