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

Method fetch

flow-rs/src/broker.rs:125–135  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

123 }
124
125 pub async fn fetch<T>(&self) -> Result<T, RecvError>
126 where
127 T: 'static + Clone + std::marker::Send,
128 {
129 self.sub.recv().await.map(|mut envelope| {
130 let envelope = envelope
131 .downcast_mut::<Envelope<T>>()
132 .expect("type error when downcast");
133 envelope.unpack()
134 })
135 }
136
137 pub fn try_fetch<T>(&self) -> Option<T>
138 where

Callers 2

startMethod · 0.45
execMethod · 0.45

Calls 2

unpackMethod · 0.80
recvMethod · 0.45

Tested by

no test coverage detected