Skip to content

Commit

Permalink
Change some imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ihaveint committed Sep 20, 2023
1 parent ab005b2 commit 9c99e5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion chorus_book/src/guide-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -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::<LocationSet!(Alice)>::new());
use chorus_lib::transport::local::{LocalTransport, LocalTransportChannel};
use chorus_lib::transport::local::{LocalTransport};

let alice_transport = LocalTransport::new(Alice, Arc::clone(&transport_channel));
```
Expand Down
16 changes: 7 additions & 9 deletions chorus_lib/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<L: HList, InfoType, TargetLocation: ChoreographyLocation, TargetInfoType>
{
/// The information about locations
pub info: std::collections::HashMap<String, InfoType>,
pub info: HashMap<String, InfoType>,
/// 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<L>,
pub location_set: PhantomData<L>,
}

/// This macro makes a `TransportConfig`.
Expand Down

0 comments on commit 9c99e5c

Please sign in to comment.