diff --git a/ofborg/src/easyamqp.rs b/ofborg/src/easyamqp.rs index 02f13a8..23b616b 100644 --- a/ofborg/src/easyamqp.rs +++ b/ofborg/src/easyamqp.rs @@ -297,28 +297,32 @@ pub fn session_from_config(config: &RabbitMQConfig) -> Result(&mut self, callback: T, config: ConsumeConfig) -> Result + type Error; + + fn consume(&mut self, callback: T, config: ConsumeConfig) -> Result where T: amqp::Consumer + 'static; fn declare_exchange( &mut self, config: ExchangeConfig, - ) -> Result; + ) -> Result; fn declare_queue( &mut self, config: QueueConfig, - ) -> Result; + ) -> Result; fn bind_queue( &mut self, config: BindQueueConfig, - ) -> Result; + ) -> Result; } impl TypedWrappers for amqp::Channel { - fn consume(&mut self, callback: T, config: ConsumeConfig) -> Result + type Error = amqp::AMQPError; + + fn consume(&mut self, callback: T, config: ConsumeConfig) -> Result where T: amqp::Consumer + 'static, { @@ -337,7 +341,7 @@ impl TypedWrappers for amqp::Channel { fn declare_exchange( &mut self, config: ExchangeConfig, - ) -> Result { + ) -> Result { self.exchange_declare( config.exchange, config.exchange_type.into(), @@ -353,7 +357,7 @@ impl TypedWrappers for amqp::Channel { fn declare_queue( &mut self, config: QueueConfig, - ) -> Result { + ) -> Result { self.queue_declare( config.queue, config.passive, @@ -368,7 +372,7 @@ impl TypedWrappers for amqp::Channel { fn bind_queue( &mut self, config: BindQueueConfig, - ) -> Result { + ) -> Result { self.queue_bind( config.queue, config.exchange,