tnetstring serialization library for rust.

Overview

TNetStrings: Tagged Netstrings

This module implements bindings for the tnetstring serialization format.

API

let t = tnetstring::str("hello world");
let s = tnetstring::to_str(t) // returns "11:hello world,"

let (t, extra) = tnetstring::from_str(s);
alt option::get(t) {
  tnetstring::str(s) { ... }
  ...
}

See the tests module in tnetstring.rs for more examples.

Compatibility

Use tag v0.1 with Rust 0.2.

You might also like...
Cap'n Proto for Rust

Cap'n Proto for Rust documentation blog Introduction Cap'n Proto is a type system for distributed systems. With Cap'n Proto, you describe your data an

A Gecko-oriented implementation of the Encoding Standard in Rust

encoding_rs encoding_rs an implementation of the (non-JavaScript parts of) the Encoding Standard written in Rust and used in Gecko (starting with Fire

Character encoding support for Rust

Encoding 0.3.0-dev Character encoding support for Rust. (also known as rust-encoding) It is based on WHATWG Encoding Standard, and also provides an ad

Rust implementation of CRC(16, 32, 64) with support of various standards

crc Rust implementation of CRC(16, 32, 64). MSRV is 1.46. Usage Add crc to Cargo.toml [dependencies] crc = "2.0" Compute CRC use crc::{Crc, Algorithm,

A CSV parser for Rust, with Serde support.

csv A fast and flexible CSV reader and writer for Rust, with support for Serde. Dual-licensed under MIT or the UNLICENSE. Documentation https://docs.r

pem-rs pem PEM jcreekmore/pem-rs [pem] — A Rust based way to parse and encode PEM-encoded data

pem A Rust library for parsing and encoding PEM-encoded data. Documentation Module documentation with examples Usage Add this to your Cargo.toml: [dep

PROST! a Protocol Buffers implementation for the Rust Language

PROST! prost is a Protocol Buffers implementation for the Rust Language. prost generates simple, idiomatic Rust code from proto2 and proto3 files. Com

Rust implementation of Google protocol buffers

rust-protobuf Protobuf implementation in Rust. Written in pure rust Generate rust code Has runtime library for generated code (Coded{Input|Output}Stre

A fast, performant implementation of skip list in Rust.
A fast, performant implementation of skip list in Rust.

Subway A fast, performant implementation of skip list in Rust. A skip list is probabilistic data structure that provides O(log N) search and insertion

Comments
  • Make tnetstring compatible with upcoming Rust version (>0.6)

    Make tnetstring compatible with upcoming Rust version (>0.6)

    The upcoming Rust version is for some parts of the Rust language not compatible with older versions:

    • Various keywords are dropped (move, pure, fail / assert macros).
    • Rename LinearMap -> HashMap.
    • LinearMap::find_ref() is dropped. I used HashMap::find() instead.
    • Fix implementation syntax (double colon is deprecated).
    • Various core library function changes.

    I compiled tnetstring successfully with this Rust version: $ rustc -v rustc 0.6 (2d28d64 2013-05-17 15:52:25 -0700) host: x86_64-unknown-linux-gnu

    opened by smvv 2
  • fails to compile with modern rustc

    fails to compile with modern rustc

    I'm using rustc 1.21.0 and getting lots of errors. The codebase is a few years old and Rust has evolved during that time, so probably it needs to be updated? Or would it make more sense to add TNetStrings support to Serde?

    opened by jkarneges 0
  • Fix building under current Rust master (std::vec dep).

    Fix building under current Rust master (std::vec dep).

    Changes are just:

    use std::vec; ... Vec -> vec::Vec

    Do switch this out if there's a tidier way of doing this that I've ignored. The persistent overlap between Vec/Vec is the source of the verbosity.

    opened by tekacs 2
  • Fix compile problem on nightly builds

    Fix compile problem on nightly builds

    Due to a variable collision between the enum member Vec and the stdlib type Vec, rust-tnetstring failed to compile for me on the latest nightly build. A little fooling around discovered the issue; this pull request fixes it.

    opened by scythe 0
Owner
Erick Tryzelaar
Erick Tryzelaar
Lazy Binary Serialization

LBS crates.io | docs.rs Library name stands for Lazy Binary Serialization. We call it "lazy" because it does not serizalize/deserialize struct fields

Roman Kuzmin 7 Feb 19, 2022
Rust library for reading/writing numbers in big-endian and little-endian.

byteorder This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order. Dual-licensed under M

Andrew Gallant 811 Jan 1, 2023
A HTML entity encoding library for Rust

A HTML entity encoding library for Rust Example usage All example assume a extern crate htmlescape; and use htmlescape::{relevant functions here}; is

Viktor Dahl 41 Nov 1, 2022
A TOML encoding/decoding library for Rust

toml-rs A TOML decoder and encoder for Rust. This library is currently compliant with the v0.5.0 version of TOML. This library will also likely contin

Alex Crichton 1k Dec 30, 2022
Astro Format is a library for efficiently encoding and decoding a set of bytes into a single buffer format.

Astro Format is a library for efficiently transcoding arrays into a single buffer and native rust types into strings

Stelar Labs 1 Aug 13, 2022
rust-jsonnet - The Google Jsonnet( operation data template language) for rust

rust-jsonnet ==== Crate rust-jsonnet - The Google Jsonnet( operation data template language) for rust Google jsonnet documet: (http://google.github.io

Qihoo 360 24 Dec 1, 2022
MessagePack implementation for Rust / msgpack.org[Rust]

RMP - Rust MessagePack RMP is a pure Rust MessagePack implementation. This repository consists of three separate crates: the RMP core and two implemen

Evgeny Safronov 840 Dec 30, 2022
A Rust ASN.1 (DER) serializer.

rust-asn1 This is a Rust library for parsing and generating ASN.1 data (DER only). Installation Add asn1 to the [dependencies] section of your Cargo.t

Alex Gaynor 85 Dec 16, 2022
Implementation of Bencode encoding written in rust

Rust Bencode Implementation of Bencode encoding written in rust. Project Status Not in active developement due to lack of time and other priorities. I

Arjan Topolovec 32 Aug 6, 2022
Encoding and decoding support for BSON in Rust

bson-rs Encoding and decoding support for BSON in Rust Index Overview of BSON Format Usage BSON Values BSON Documents Modeling BSON with strongly type

mongodb 304 Dec 30, 2022