macro_rules! dyn_channel_methods {
() => {
pub fn close(&self) -> bool {
self.channel.close()
}
pub fn halt(&self) {
self.channel.halt_some(u32::MAX)
}
pub fn halt_some(&self, n: u32) {
self.channel.halt_some(n)
}
pub fn process_count(&self) -> usize {
self.channel.inbox_count()
}
pub fn msg_count(&self) -> usize {
self.channel.msg_count()
}
pub fn address_count(&self) -> usize {
self.channel.address_count()
}
pub fn is_closed(&self) -> bool {
self.channel.is_closed()
}
pub fn is_bounded(&self) -> bool {
self.channel.is_bounded()
}
pub fn capacity(&self) -> &Capacity {
self.channel.capacity()
}
pub fn has_exited(&self) -> bool {
self.channel.has_exited()
}
pub fn actor_id(&self) -> u64 {
self.channel.actor_id()
}
};
}
pub(crate) use dyn_channel_methods;
macro_rules! send_methods {
() => {
pub fn try_send(&self, msg: M) -> Result<(), TrySendError<M>> {
self.channel.try_send(msg)
}
pub fn send_now(&self, msg: M) -> Result<(), TrySendError<M>> {
self.channel.send_now(msg)
}
pub fn send(&self, msg: M) -> Snd<'_, M> {
self.channel.send(msg)
}
pub fn send_blocking(&self, msg: M) -> Result<(), SendError<M>> {
self.channel.send_blocking(msg)
}
};
}
pub(crate) use send_methods;
macro_rules! child_methods {
() => {
pub fn attach(&mut self, duration: Duration) -> Option<Duration> {
self.link.attach(duration)
}
pub fn detach(&mut self) -> Option<Duration> {
self.link.detach()
}
pub fn is_aborted(&self) -> bool {
self.is_aborted
}
pub fn is_attached(&self) -> bool {
self.link.is_attached()
}
pub fn link(&self) -> &Link {
&self.link
}
};
}
pub(crate) use child_methods;