summaryrefslogtreecommitdiff
path: root/src/rust/protover/lib.rs
diff options
context:
space:
mode:
authorIsis Lovecruft <isis@torproject.org>2018-03-21 00:43:55 +0000
committerIsis Lovecruft <isis@torproject.org>2018-04-02 19:04:19 +0000
commit9925d2e68709aa7346f4c5bc98ea1349df6741f3 (patch)
treed7eae6916a7b161a1d7b0323c71e1396d55f5102 /src/rust/protover/lib.rs
parentb6059297d7cb76f0e00e2098e38d6677d3033340 (diff)
downloadtor-9925d2e68709aa7346f4c5bc98ea1349df6741f3.tar.gz
tor-9925d2e68709aa7346f4c5bc98ea1349df6741f3.zip
rust: Implement more memory-efficient protover datatype.
* ADD new protover::protoset module. * ADD new protover::protoset::ProtoSet class for holding protover versions. * REMOVE protover::Versions type implementation and its method `from_version_string()`, and instead implement this behaviour in a more rust-like manner as `impl FromStr for ProtoSet`. * MOVE the `find_range()` utility function from protover::protover to protover::protoset since it's only used internally in the implementation of ProtoSet. * REMOVE the `contract_protocol_list()` function from protover::protover and instead refactor it (reusing nearly the entire thing, with minor superficial, i.e. non-behavioural, changes) into a more rusty `impl ToString for ProtoSet`. * REMOVE the `expand_version_range()` function from protover::protover and instead refactor it into a more rusty implementation of `impl Into<Vec<Version>> for ProtoSet` using the new error types in protover::errors. * FIXES part of #24031: https://bugs.torproject.org/24031.
Diffstat (limited to 'src/rust/protover/lib.rs')
-rw-r--r--src/rust/protover/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rust/protover/lib.rs b/src/rust/protover/lib.rs
index 2455d50818..9a9f92ed74 100644
--- a/src/rust/protover/lib.rs
+++ b/src/rust/protover/lib.rs
@@ -35,6 +35,7 @@ extern crate tor_util;
extern crate tor_log;
pub mod errors;
+pub mod protoset;
mod protover;
pub mod ffi;