From 9c99e5cb058acd88a1b9eb568f68d1d1cf7ec431 Mon Sep 17 00:00:00 2001 From: Soroush Zare Date: Wed, 20 Sep 2023 03:07:07 -0700 Subject: [PATCH] Change some imports --- chorus_book/src/guide-transport.md | 3 ++- chorus_lib/src/transport.rs | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/chorus_book/src/guide-transport.md b/chorus_book/src/guide-transport.md index a021db1..93a5b6e 100644 --- a/chorus_book/src/guide-transport.md +++ b/chorus_book/src/guide-transport.md @@ -33,8 +33,9 @@ To use the `local` transport, first import the `LocalTransport` struct from the # use chorus_lib::{LocationSet}; # #[derive(ChoreographyLocation)] # struct Alice; +# use chorus_lib::transport::local::LocalTransportChannel; # let transport_channel = Arc::new(LocalTransportChannel::::new()); -use chorus_lib::transport::local::{LocalTransport, LocalTransportChannel}; +use chorus_lib::transport::local::{LocalTransport}; let alice_transport = LocalTransport::new(Alice, Arc::clone(&transport_channel)); ``` diff --git a/chorus_lib/src/transport.rs b/chorus_lib/src/transport.rs index a4e8996..b49d255 100644 --- a/chorus_lib/src/transport.rs +++ b/chorus_lib/src/transport.rs @@ -3,22 +3,20 @@ pub mod http; pub mod local; -use crate::core::ChoreographyLocation; +use crate::core::{ChoreographyLocation, HList}; +use std::collections::HashMap; +use std::marker::PhantomData; /// A generic struct for configuration of `Transport`. #[derive(Clone)] -pub struct TransportConfig< - L: crate::core::HList, - InfoType, - TargetLocation: ChoreographyLocation, - TargetInfoType, -> { +pub struct TransportConfig +{ /// The information about locations - pub info: std::collections::HashMap, + pub info: HashMap, /// The information about the target choreography pub target_info: (TargetLocation, TargetInfoType), /// The struct is parametrized by the location set (`L`). - pub location_set: std::marker::PhantomData, + pub location_set: PhantomData, } /// This macro makes a `TransportConfig`.