# pipenet
[![crates.io](https://img.shields.io/crates/v/pipenet)](https://crates.io/crates/pipenet)
[![docs.rs](https://img.shields.io/docsrs/pipenet)](https://docs.rs/pipenet)
![NOAI](https://img.shields.io/badge/NO-AI-red)
[![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page)

Non blocking tcp stream wrapper for rust.

```rust
use std::net::{TcpStream, SocketAddr};
use serde::{Serialize, Deserialize};
use pipenet::NonBlockStream;

#[derive(Serialize, Deserialize)]
struct MyType {
    x: i32,
    y: i32,
}

let stream = TcpStream::connect(SocketAddr::from(([127, 0, 0, 1], 9999))).unwrap();
let mut nbstream: NonBlockStream<MyType> = stream.into();

// A simple, one time, echo example
if let Some(msg) = nbstream.read().unwrap() {
    nbstream.write(msg).unwrap();
}
```
