Added missing documentation

This commit is contained in:
Daniel Sanchez Quiros 2022-10-09 09:33:08 -05:00
parent 6ff110bbe8
commit f1a5283ef5
3 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,9 @@ impl Signal {
}
}
/// Waku event
/// For now just WakuMessage is supported
#[non_exhaustive]
#[derive(Serialize, Deserialize)]
#[serde(tag = "untagged", rename_all = "camelCase")]
pub enum Event {

View File

@ -11,9 +11,11 @@ use sscanf::{scanf, RegexRepresentation};
// internal
use crate::decrypt::{waku_decode_asymmetric, waku_decode_symmetric};
/// Waku message version
pub type WakuMessageVersion = usize;
/// Base58 encoded peer id
pub type PeerId = String;
/// Waku message id, hex encoded sha256 digest of the message
pub type MessageId = String;
/// JsonResponse wrapper.
@ -244,6 +246,7 @@ pub struct MessageIndex {
pub pubsub_topic: WakuPubSubTopic,
}
/// WakuMessage encoding scheme
#[derive(Copy, Clone)]
pub enum Encoding {
Proto,
@ -279,6 +282,7 @@ impl RegexRepresentation for Encoding {
const REGEX: &'static str = r"\w";
}
/// A waku content topic `/{application_name}/{version}/{content_topic_name}/{encdoing}`
#[derive(Clone)]
pub struct WakuContentTopic {
pub application_name: String,
@ -342,6 +346,7 @@ impl<'de> Deserialize<'de> for WakuContentTopic {
}
}
/// A waku pubsub topic in the form of `/waku/v2/{topic_name}/{encoding}`
#[derive(Clone)]
pub struct WakuPubSubTopic {
pub topic_name: String,

View File

@ -113,6 +113,12 @@ pub fn waku_peer_count() -> Result<usize> {
result.into()
}
/// Waku peer supported protocol
///
/// Examples:
/// `"/ipfs/id/1.0.0"`
/// `"/vac/waku/relay/2.0.0"`
/// `"/ipfs/ping/1.0.0"`
pub type Protocol = String;
/// Peer data from known/connected waku nodes