MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / send_empty_f

Function send_empty_f

flow-derive/src/actor.rs:26–48  ·  view source on GitHub ↗
((_, ident, ty): ExtractParams)

Source from the content-addressed store, hash-verified

24 };
25
26 fn send_empty_f((_, ident, ty): ExtractParams) -> TokenStream {
27 if match_last_ty(ty, "Vec") {
28 quote_spanned! {ident.span()=>
29 for chan in &self.#ident {
30 chan.send_any(flow_rs::envelope::DummyEnvelope{}.seal()).await.ok();
31 }
32 }
33 } else if match_last_ty(ty, "HashMap") {
34 quote_spanned! {ident.span()=>
35 for chan in self.#ident.values() {
36 chan.send_any(flow_rs::envelope::DummyEnvelope{}.seal()).await.ok();
37 }
38 }
39 } else if match_last_ty(ty, "DynPorts") {
40 quote_spanned! (ident.span()=>
41 for chan in self.#ident.cache().values() {
42 chan.send_any(flow_rs::envelope::DummyEnvelope{}.seal()).await.ok();
43 }
44 )
45 } else {
46 quote_spanned! (ident.span()=>self.#ident.send_any(flow_rs::envelope::DummyEnvelope{}.seal()).await.ok();)
47 }
48 }
49 fn min_empty_n_f((_, ident, ty): ExtractParams) -> TokenStream {
50 if match_last_ty(ty, "Vec") {
51 quote_spanned! {ident.span()=>

Callers

nothing calls this directly

Calls 1

match_last_tyFunction · 0.85

Tested by

no test coverage detected