Skip to content
Snippets Groups Projects
Commit 52aeab40 authored by Carl Lerche's avatar Carl Lerche
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
/target
/Cargo.lock
[package]
name = "bytes"
version = "0.0.1"
authors = ["Carl Lerche <me@carllerche.com>"]
description = "Types and traits for working with bytes"
license = "MIT"
# include = [
# "Cargo.toml",
# "src/**/*.rs",
# ]
#![crate_name = "bytes"]
/// A trait for objects that provide random and sequential access to bytes.
pub trait Buf {
fn remaining(&self) -> usize;
fn bytes<'a>(&'a self) -> &'a [u8];
fn advance(&mut self, cnt: usize);
fn has_remaining(&self) -> bool {
self.remaining() > 0
}
}
pub trait MutBuf : Buf {
fn mut_bytes<'a>(&'a mut self) -> &'a mut [u8];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment