(&mut self)
| 129 | |
| 130 | #[inline] |
| 131 | pub async fn next(&mut self) -> Option<ResultType<(BytesMut, TargetAddr<'static>)>> { |
| 132 | match self { |
| 133 | Self::Direct(f) => match f.next().await { |
| 134 | Some(Ok((data, addr))) => { |
| 135 | Some(Ok((data, addr.into_target_addr().ok()?.to_owned()))) |
| 136 | } |
| 137 | Some(Err(e)) => Some(Err(anyhow!(e))), |
| 138 | None => None, |
| 139 | }, |
| 140 | Self::ProxySocks(f) => match f.next().await { |
| 141 | Some(Ok((data, _))) => Some(Ok((data.data, data.dst_addr))), |
| 142 | Some(Err(e)) => Some(Err(anyhow!(e))), |
| 143 | None => None, |
| 144 | }, |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | #[inline] |
| 149 | pub async fn next_timeout( |
no outgoing calls