Added location to CocoPresence

This commit is contained in:
Jedrzej Stuczynski
2020-03-13 16:46:04 +00:00
parent ab5656ce94
commit 3ade837579
@@ -4,6 +4,7 @@ use topology::coco;
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CocoPresence {
pub location: String,
pub host: String,
pub pub_key: String,
pub last_seen: u64,
@@ -13,6 +14,7 @@ pub struct CocoPresence {
impl Into<topology::coco::Node> for CocoPresence {
fn into(self) -> topology::coco::Node {
topology::coco::Node {
location: self.location,
host: self.host,
pub_key: self.pub_key,
last_seen: self.last_seen,
@@ -24,6 +26,7 @@ impl Into<topology::coco::Node> for CocoPresence {
impl From<topology::coco::Node> for CocoPresence {
fn from(cn: coco::Node) -> Self {
CocoPresence {
location: cn.location,
host: cn.host,
pub_key: cn.pub_key,
last_seen: cn.last_seen,