pub struct AsyncChannel {
pub channel: Channel,
pub connection: Arc<Mutex<Connection>>,
pub aux_channel: Option<Channel>,
pub aux_queue_name: String,
pub rpc_futures: Arc<DashMap<String, Sender<Vec<u8>>>>,
pub rpc_consumer_started: Arc<AtomicBool>,
pub shutdown_notify: Arc<Notify>,
/* private fields */
}Fields§
§channel: Channel§connection: Arc<Mutex<Connection>>§aux_channel: Option<Channel>§aux_queue_name: String§rpc_futures: Arc<DashMap<String, Sender<Vec<u8>>>>§rpc_consumer_started: Arc<AtomicBool>§shutdown_notify: Arc<Notify>Implementations§
Source§impl AsyncChannel
impl AsyncChannel
pub fn new( channel: Channel, connection: Arc<Mutex<Connection>>, channel_tx: UnboundedSender<ChannelCmd>, rpc_futures: Arc<DashMap<String, Sender<Vec<u8>>>>, publisher_confirms: Confirmations, auto_ack: bool, pre_fetch_count: Option<u16>, aux_queue_name: Option<String>, ) -> Self
pub async fn reopen(&mut self, channel_id: u16) -> Result<(), AppError>
pub async fn add_subscribe( &self, queue_name: &str, routing_key: &str, handler: InternalSubscribeHandler, )
pub async fn add_rpc_subscribe( &self, queue_name: &str, routing_key: &str, handler: InternalRPCHandler, )
pub async fn queue_bind( &self, queue_name: &str, exchange_name: &str, routing_key: &str, ) -> Result<(), AppError>
pub async fn set_qos(&self, prefetch_count: u16) -> Result<(), AppError>
pub async fn setup_exchange( &self, exchange_name: &str, exchange_type: &str, durable: bool, ) -> Result<(), AppError>
pub async fn publish( &self, exchange_name: &str, routing_key: &str, body: impl Into<Vec<u8>>, content_type: &str, content_encoding: ContentEncoding, delivery_mode: DeliveryMode, expiration: Option<u32>, ) -> Result<(), AppError>
pub async fn queue_declare( &self, queue_name: &str, queue_options: &QueueOptions, ) -> Result<(), AppError>
pub async fn close(&self) -> Result<(), AppError>
pub async fn subscribe( &self, handler: Handler, routing_key: &str, exchange_name: &str, exchange_type: &str, queue_name: &str, process_timeout: Option<Duration>, queue_options: &QueueOptions, ) -> Result<(), AppError>
pub async fn unsubscribe(&self, consumer_tag: &str) -> Result<(), AppError>
pub async fn rpc_server( &mut self, handler: RPCHandler, routing_key: &str, exchange_name: &str, exchange_type: &str, queue_name: &str, response_timeout: Option<Duration>, queue_options: &QueueOptions, ) -> Result<(), AppError>
pub async fn start_rpc_consumer(&mut self) -> Result<(), AppError>
pub async fn rpc_client( &mut self, exchange_name: &str, routing_key: &str, body: impl Into<Vec<u8>>, content_type: &str, content_encoding: ContentEncoding, timeout_millis: u32, delivery_mode: DeliveryMode, expiration: Option<u32>, response: Sender<Result<Vec<u8>, AppError>>, clean_message: UnboundedSender<ChannelCmd>, message_id: Option<u64>, ) -> Result<(), AppError>
pub async fn dispose(&self)
Trait Implementations§
Source§impl Clone for AsyncChannel
impl Clone for AsyncChannel
Source§fn clone(&self) -> AsyncChannel
fn clone(&self) -> AsyncChannel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AsyncChannel
impl !RefUnwindSafe for AsyncChannel
impl Send for AsyncChannel
impl Sync for AsyncChannel
impl Unpin for AsyncChannel
impl UnsafeUnpin for AsyncChannel
impl !UnwindSafe for AsyncChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more