Logo
Explore Help
Sign In
logos-messaging/logos-messaging-rust-bindings
1
0
Fork 0
You've already forked logos-messaging-rust-bindings
mirror of https://github.com/logos-messaging/logos-messaging-rust-bindings.git synced 2026-01-05 23:43:11 +00:00
Code Issues Packages Projects Releases Wiki Activity
logos-messaging-rust-bindings/waku-bindings/src/general/pubsubtopic.rs

17 lines
397 B
Rust
Raw Normal View History

Tic tac toe example (#104) * update nwaku vendor to v0.33.1 * build.rs: add negentropy dependency and cmdCount cmdLine dependencies * fix: call waku_setup when instantiating waku_new * Properly decode a Vec<Multiaddr> * First commit tic-tac-toe * adding some simple game logic to coordinate the turns a little * some logic to panic if a proper event callback hasn't been set * restoring back the type state pattern introduced by Richard * new PubsubTopic type * fix clippy issues --------- Co-authored-by: Richard Ramos <info@richardramos.me>
2024-11-28 10:35:41 +01:00
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PubsubTopic(String);
impl PubsubTopic {
// Constructor to create a new MyString
pub fn new(value: &str) -> Self {
PubsubTopic(value.to_string())
}
}
// to allow conversion from `PubsubTopic` to `String`
impl From<&PubsubTopic> for String {
fn from(topic: &PubsubTopic) -> Self {
topic.0.to_string()
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.0 Page: 32ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API