Expose node_id and known nodes of server via function

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/1/head
trivernis 4 years ago
parent ecc3fcb204
commit 5e659509dd
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,7 +1,7 @@
[package]
name = "vented"
description = "Event driven encrypted tcp communicaton"
version = "0.2.1"
version = "0.3.0"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
readme = "README.md"

@ -95,6 +95,16 @@ impl VentedServer {
}
}
/// Returns the nodeId of the server
pub fn node_id(&self) -> String {
self.node_id.clone()
}
/// Returns the nodes known to the server
pub fn nodes(&self) -> Vec<Node> {
self.known_nodes.lock().clone()
}
/// Emits an event to the specified Node
/// The actual writing is done in a separate thread from the thread pool.
/// With the returned waitgroup one can wait for the event to be written.

Loading…
Cancel
Save