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

Method send

libs/hbb_common/src/udp.rs:92–108  ·  view source on GitHub ↗
(
        &mut self,
        msg: &impl Message,
        addr: impl IntoTargetAddr<'_>,
    )

Source from the content-addressed store, hash-verified

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]

Callers 8

send_stateMethod · 0.45
dropMethod · 0.45
send_rawMethod · 0.45
send_current_digestMethod · 0.45
handle_read_jobsFunction · 0.45
start_recordFunction · 0.45
mainFunction · 0.45
transcribeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected