pub mod sync {
mod generated {
use crate::p2::{FsError, SocketError};
use wasmtime_wasi_io::streams::StreamError;
wasmtime::component::bindgen!({
path: "src/p2/wit",
world: "wasi:cli/command",
trappable_error_type: {
"wasi:io/streams.stream-error" => StreamError,
"wasi:filesystem/types.error-code" => FsError,
"wasi:sockets/network.error-code" => SocketError,
},
imports: { default: tracing | trappable },
with: {
"wasi:clocks": crate::p2::bindings::clocks,
"wasi:random": crate::p2::bindings::random,
"wasi:cli": crate::p2::bindings::cli,
"wasi:filesystem/preopens": crate::p2::bindings::filesystem::preopens,
"wasi:sockets/network": crate::p2::bindings::sockets::network,
"wasi:filesystem/types.descriptor": crate::filesystem::Descriptor,
"wasi:filesystem/types.directory-entry-stream": super::super::filesystem::types::DirectoryEntryStream,
"wasi:sockets/tcp.tcp-socket": super::super::sockets::tcp::TcpSocket,
"wasi:sockets/udp.incoming-datagram-stream": super::super::sockets::udp::IncomingDatagramStream,
"wasi:sockets/udp.outgoing-datagram-stream": super::super::sockets::udp::OutgoingDatagramStream,
"wasi:sockets/udp.udp-socket": crate::sockets::UdpSocket,
"wasi:io/error": wasmtime_wasi_io::bindings::wasi::io::error,
"wasi:io/poll.pollable": wasmtime_wasi_io::poll::DynPollable,
"wasi:io/streams.input-stream": wasmtime_wasi_io::streams::DynInputStream,
"wasi:io/streams.output-stream": wasmtime_wasi_io::streams::DynOutputStream,
},
require_store_data_send: true,
});
}
pub use self::generated::exports;
pub use self::generated::wasi::*;
pub use self::generated::Command;
pub use self::generated::CommandPre;
pub use self::generated::CommandIndices;
pub use self::generated::LinkOptions;
}
mod async_io {
wasmtime::component::bindgen!({
path: "src/p2/wit",
world: "wasi:cli/command",
imports: {
"wasi:filesystem/types.[method]descriptor.advise": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.create-directory-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.get-flags": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.get-type": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.is-same-object": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.link-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.metadata-hash": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.metadata-hash-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.open-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.read": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.read-directory": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.readlink-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.remove-directory-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.rename-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.set-size": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.set-times": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.set-times-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.stat": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.stat-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.symlink-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.sync": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.sync-data": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.unlink-file-at": async | tracing | trappable,
"wasi:filesystem/types.[method]descriptor.write": async | tracing | trappable,
"wasi:filesystem/types.[method]directory-entry-stream.read-directory-entry": async | tracing | trappable,
"wasi:sockets/tcp.[method]tcp-socket.start-bind": async | tracing | trappable,
"wasi:sockets/tcp.[method]tcp-socket.start-connect": async | tracing | trappable,
"wasi:sockets/udp.[method]udp-socket.start-bind": async | tracing | trappable,
"wasi:sockets/udp.[method]udp-socket.stream": async | tracing | trappable,
"wasi:sockets/udp.[method]outgoing-datagram-stream.send": async | tracing | trappable,
default: tracing | trappable,
},
exports: { default: async },
trappable_error_type: {
"wasi:io/streams.stream-error" => wasmtime_wasi_io::streams::StreamError,
"wasi:filesystem/types.error-code" => crate::p2::FsError,
"wasi:sockets/network.error-code" => crate::p2::SocketError,
},
with: {
"wasi:io/poll": wasmtime_wasi_io::bindings::wasi::io::poll,
"wasi:io/streams": wasmtime_wasi_io::bindings::wasi::io::streams,
"wasi:io/error": wasmtime_wasi_io::bindings::wasi::io::error,
"wasi:sockets/network.network": crate::p2::network::Network,
"wasi:sockets/tcp.tcp-socket": crate::sockets::TcpSocket,
"wasi:sockets/udp.udp-socket": crate::sockets::UdpSocket,
"wasi:sockets/udp.incoming-datagram-stream": crate::p2::udp::IncomingDatagramStream,
"wasi:sockets/udp.outgoing-datagram-stream": crate::p2::udp::OutgoingDatagramStream,
"wasi:sockets/ip-name-lookup.resolve-address-stream": crate::p2::ip_name_lookup::ResolveAddressStream,
"wasi:filesystem/types.directory-entry-stream": crate::p2::filesystem::ReaddirIterator,
"wasi:filesystem/types.descriptor": crate::filesystem::Descriptor,
"wasi:cli/terminal-input.terminal-input": crate::p2::stdio::TerminalInput,
"wasi:cli/terminal-output.terminal-output": crate::p2::stdio::TerminalOutput,
},
});
}
pub use self::async_io::LinkOptions;
pub use self::async_io::exports;
pub use self::async_io::wasi::*;
pub use self::async_io::Command;
pub use self::async_io::CommandPre;
pub use self::async_io::CommandIndices;