MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / receive

Method receive

tcp/src/main.rs:106–121  ·  view source on GitHub ↗
(&'a mut self)

Source from the content-addressed store, hash-verified

104 }
105
106 fn receive(&'a mut self) -> Option<(Self::RxToken, Self::TxToken)> {
107 match message::rcall(self.handle.as_ref(),
108 message::READ,
109 0.into(), 0.into(), None) {
110 Ok((message::DATA, length, data)) => {
111 Some((RxToken{length:length.value() as usize,
112 data:data.memory()},
113 TxToken{handle: self.handle.clone()}))
114 }
115 Ok((message::EMPTY, _, _)) => None,
116 value => {
117 println!("[tcp] received unexpected {:?}", value);
118 None
119 }
120 }
121 }
122
123 fn transmit(&'a mut self) -> Option<Self::TxToken> {
124 Some(TxToken{handle: self.handle.clone()})

Callers

nothing calls this directly

Calls 5

rcallFunction · 0.85
valueMethod · 0.80
memoryMethod · 0.80
cloneMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected