MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / pull

Method pull

plugins/wasi_crypto/common/array_output.cpp:13–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace Common {
12
13std::tuple<size_t, bool> ArrayOutput::pull(Span<uint8_t> Buf) noexcept {
14 std::scoped_lock Lock{Mutex};
15
16 using DataPosT = decltype(Data)::difference_type;
17
18 size_t OutputSize = std::min(Buf.size(), Data.size() - Pos);
19
20 std::copy(Data.begin() + static_cast<DataPosT>(Pos),
21 Data.begin() + static_cast<DataPosT>(Pos + OutputSize),
22 Buf.begin());
23 Pos += OutputSize;
24
25 return {OutputSize, Pos + OutputSize == Data.size()};
26}
27
28} // namespace Common
29} // namespace WasiCrypto

Callers 1

arrayOutputPullMethod · 0.45

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected