Struct confitul::RemoteHost
source · pub struct RemoteHost { /* private fields */ }Expand description
A remote host, for which this program instance is not responsible.
Typically, this is a host about which we gathered informations, but it is not local so, among other things, we can not really trust it and we do not have its private key.
This should NOT be serialized as it is not trustable. Instead, de-serialize from the HostInfo struct then call the constructor, which checks for integrity.
Implementations§
source§impl RemoteHost
impl RemoteHost
sourcepub fn new(info: &HostInfo) -> Result<RemoteHost, Error>
pub fn new(info: &HostInfo) -> Result<RemoteHost, Error>
Create a new remote host.
The typical way to build this is from host info which has been serialized, sent over the wire, then de-serialized into a host info.
Examples
use confitul::LocalHost;
use confitul::RemoteHost;
use confitul::Host;
let lh = LocalHost::new(None).unwrap();
let rh = RemoteHost::new(&lh.info()).unwrap();
print!("{}\n{}\n", lh, rh);