MCPcopy Create free account
hub / github.com/Recordscript/recordscript / next_timeout

Method next_timeout

libs/hbb_common/src/udp.rs:149–160  ·  view source on GitHub ↗
(
        &mut self,
        ms: u64,
    )

Source from the content-addressed store, hash-verified

147
148 #[inline]
149 pub async fn next_timeout(
150 &mut self,
151 ms: u64,
152 ) -> Option<ResultType<(BytesMut, TargetAddr<'static>)>> {
153 if let Ok(res) =
154 tokio::time::timeout(std::time::Duration::from_millis(ms), self.next()).await
155 {
156 res
157 } else {
158 None
159 }
160 }
161
162 pub fn local_addr(&self) -> Option<SocketAddr> {
163 if let FramedSocket::Direct(x) = self {

Callers

nothing calls this directly

Calls 2

timeoutFunction · 0.85
nextMethod · 0.45

Tested by

no test coverage detected