mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-03 22:43:07 +00:00
Added missing documentation
This commit is contained in:
parent
6ff110bbe8
commit
f1a5283ef5
@ -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 {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user