(
&mut self,
msg: &impl Message,
addr: impl IntoTargetAddr<'_>,
)
| 90 | |
| 91 | #[inline] |
| 92 | pub async fn send( |
| 93 | &mut self, |
| 94 | msg: &impl Message, |
| 95 | addr: impl IntoTargetAddr<'_>, |
| 96 | ) -> ResultType<()> { |
| 97 | let addr = addr.into_target_addr()?.to_owned(); |
| 98 | let send_data = Bytes::from(msg.write_to_bytes()?); |
| 99 | match self { |
| 100 | Self::Direct(f) => { |
| 101 | if let TargetAddr::Ip(addr) = addr { |
| 102 | f.send((send_data, addr)).await? |
| 103 | } |
| 104 | } |
| 105 | Self::ProxySocks(f) => f.send((send_data, addr)).await?, |
| 106 | }; |
| 107 | Ok(()) |
| 108 | } |
| 109 | |
| 110 | // https://stackoverflow.com/a/68733302/1926020 |
| 111 | #[inline] |
no outgoing calls
no test coverage detected