mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-05 23:43:11 +00:00
17 lines
397 B
Rust
17 lines
397 B
Rust
|
|
#[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()
|
||
|
|
}
|
||
|
|
}
|