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

Method send_raw

libs/hbb_common/src/udp.rs:112–128  ·  view source on GitHub ↗
(
        &mut self,
        msg: &'static [u8],
        addr: impl IntoTargetAddr<'static>,
    )

Source from the content-addressed store, hash-verified

110 // https://stackoverflow.com/a/68733302/1926020
111 #[inline]
112 pub async fn send_raw(
113 &mut self,
114 msg: &'static [u8],
115 addr: impl IntoTargetAddr<'static>,
116 ) -> ResultType<()> {
117 let addr = addr.into_target_addr()?.to_owned();
118
119 match self {
120 Self::Direct(f) => {
121 if let TargetAddr::Ip(addr) = addr {
122 f.send((Bytes::from(msg), addr)).await?
123 }
124 }
125 Self::ProxySocks(f) => f.send((Bytes::from(msg), addr)).await?,
126 };
127 Ok(())
128 }
129
130 #[inline]
131 pub async fn next(&mut self) -> Option<ResultType<(BytesMut, TargetAddr<'static>)>> {

Callers

nothing calls this directly

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected