rust-pixelflut is a sync and async implementation of the pixelflut protocol for Rust.
Import in rust project:
toml
[dependencies]
pixelflut = { version = "0.1.0", features = ["sync"]}
To enable the async library with tokio use the "async" feature.
To enable support for the image crate use the "image" feature.
```rust extern crate pixelflut;
use pixelflut::sync::Client; use pixelflut::Pixel;
use std::error::Error; use std::net::SocketAddr;
fn main() -> Result<(), Box
// get the screen size
let (w, h) = client.size()?;
println!("Size: {}x{}", w, h);
// write a red line
for i in 5..10 {
client.set(Pixel::new((i,6), (255,0,0)))?;
}
Ok(())
} ```
MIT