Documentation can always be better!
This commit is contained in:
parent
854b52db9c
commit
fb37ffd0e6
2 changed files with 27 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "packeteer"
|
||||
description = "An attempt at a Rust library that can be used to assist in programmatically analysing, serving and handling received protocol packets."
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
edition = "2021"
|
||||
authors = ["Celeste <colean@colean.cc>"]
|
||||
license = "LGPL-3.0-or-later"
|
||||
|
|
27
src/lib.rs
27
src/lib.rs
|
@ -3,7 +3,32 @@
|
|||
//! In all seriousness, packeteer is a crate made to assist with programmatically analysing, serving and handling received protocol packets.
|
||||
//! This is great for servers, clients, proxies as well as packet sniffers, capturers and analysers.
|
||||
//! Packeteer doesn't implement any ability to send or receive requests/responses nor does it handle streams or threads for you and is instead supposed to be used in applications to structure packets and potentially do automated operations on them as defined by packeteer modules.
|
||||
|
||||
//!
|
||||
//! To include packeteer in your project, you'll need to enable the modules you need. For example, if you required the usage of the http1 module, you would add the following to your `Cargo.toml` file:
|
||||
//!
|
||||
//! ```toml
|
||||
//! packeteer = { version = "0.1", features = ["http1"] }
|
||||
//! ```
|
||||
//!
|
||||
//! It's safe to use ambigious version numbers that exclude the bugfix number as breaking changes or new features will result in an increment of the minor version number, or possibly major version number in the future.
|
||||
//!
|
||||
//! Packeteer aims to use as little dependencies as possible. The less dependenices that packeteer uses, the less storage your project uses. Being conservative with dependencies also makes compilation infinitely faster.
|
||||
//!
|
||||
//! An example of request generation using the http1 module:
|
||||
//!
|
||||
//! ```no_run
|
||||
//! use packeteer::http1::*
|
||||
//!
|
||||
//! fn main() {
|
||||
//! // generate_request(method, host, location, body)
|
||||
//! // GET requests don't really require bodies.
|
||||
//! let request = generate_request("GET", "example.service", "/api/example_endpoint", "");
|
||||
//! let req_raw = unpack_request(request);
|
||||
//!
|
||||
//! // Now to send req_raw through a stream to your client!
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
/// A global structure for key value headers.
|
||||
/// Can be automatically generated with the function packeteer::generate_kvheader.
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Reference in a new issue