return exchanges from dashboard

This commit is contained in:
nora 2022-03-26 13:31:12 +01:00
parent 40f25d1db7
commit d77c31aaad
2 changed files with 71 additions and 2 deletions

View file

@ -1,4 +1,9 @@
use std::{borrow::Borrow, collections::HashMap, sync::Arc};
use std::{
borrow::Borrow,
collections::HashMap,
fmt::{Display, Formatter},
sync::Arc,
};
use crate::{newtype, Queue};
@ -9,6 +14,16 @@ pub enum TopicSegment {
MultiWildcard,
}
impl Display for TopicSegment {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::Word(str) => str.fmt(f),
Self::SingleWildcard => f.write_str("*"),
Self::MultiWildcard => f.write_str("#"),
}
}
}
#[derive(Debug)]
pub enum ExchangeType {
/// Routes a message to a queue if the routing-keys are equal