/
germanubis
/
lapin
Обзор
Документация
Войти
/
germanubis
/
lapin
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/queue.rs
41 строка
820 B
Marc-Antoine Perennou
update amq-protocol
26 дек 2020, 19:33
26 дек 2020, 19:33
4705e9d
Код
Авторство
О чём код?
use crate::types::{ConsumerCount, MessageCount, ShortString}; use std::borrow::Borrow; #[derive(Clone, Debug)] pub struct Queue { name: ShortString, message_count: MessageCount, consumer_count: ConsumerCount, } impl Queue { pub(crate) fn new( name: ShortString, message_count: MessageCount, consumer_count: ConsumerCount, ) -> Self { Self { name, message_count, consumer_count, } } pub fn name(&self) -> &ShortString { &self.name } pub fn message_count(&self) -> MessageCount { self.message_count } pub fn consumer_count(&self) -> ConsumerCount { self.consumer_count } } impl Borrow<str> for Queue { fn borrow(&self) -> &str { self.name.as_str() } }