use crate::protocol::BasicProtocol; use std::marker::PhantomData; /// Upstream, used by Workspace to describe the protocol of UpstreamVault pub struct Upstream where Protocol: BasicProtocol, { /// Protocol of the target upstream machine _p: PhantomData, /// Address of the target upstream machine target_address: String, } impl Upstream where Protocol: BasicProtocol, { pub fn new(addr: &str) -> Self { Upstream { _p: PhantomData, target_address: addr.to_string(), } } } /// Host, used by Vault to describe its own protocol pub struct Host where Protocol: BasicProtocol, { /// Protocol of the target upstream machine _p: PhantomData, } impl Upstream where Protocol: BasicProtocol, { pub fn address(addr: &str) -> Self { Upstream { _p: PhantomData, target_address: addr.to_string(), } } } impl Host where Protocol: BasicProtocol, { pub fn new() -> Self { Host { _p: PhantomData } } }