pub trait OcallFuncs {
Show 25 methods fn close(&mut self, resource_id: i32) -> Result<()>; fn poll(&mut self, waker_id: i32, resource_id: i32) -> Result<Vec<u8>>; fn poll_read(
        &mut self,
        waker_id: i32,
        resource_id: i32,
        data: &mut [u8]
    ) -> Result<u32>; fn poll_write(
        &mut self,
        waker_id: i32,
        resource_id: i32,
        data: &[u8]
    ) -> Result<u32>; fn poll_shutdown(&mut self, waker_id: i32, resource_id: i32) -> Result<()>; fn poll_res(&mut self, waker_id: i32, resource_id: i32) -> Result<i32>; fn mark_task_ready(&mut self, task_id: i32) -> Result<()>; fn next_ready_task(&mut self) -> Result<i32>; fn enable_ocall_trace(&mut self, enable: bool) -> Result<()>; fn awake_wakers(&mut self) -> Result<Vec<i32>>; fn getrandom(&mut self, buf: &mut [u8]) -> Result<()>; fn create_timer(&mut self, timeout: i32) -> Result<i32>; fn oneshot_send(&mut self, resource_id: i32, data: &[u8]) -> Result<()>; fn gas_remaining(&mut self) -> Result<u8>; fn tcp_listen(
        &mut self,
        addr: Cow<'_, str>,
        tls_config: Option<TlsServerConfig>
    ) -> Result<i32>; fn tcp_accept(
        &mut self,
        waker_id: i32,
        resource_id: i32
    ) -> Result<(i32, String)>; fn tcp_accept_no_addr(
        &mut self,
        waker_id: i32,
        resource_id: i32
    ) -> Result<i32>; fn tcp_connect(&mut self, host: &str, port: u16) -> Result<i32>; fn tcp_connect_tls(
        &mut self,
        host: String,
        port: u16,
        config: TlsClientConfig
    ) -> Result<i32>; fn log(&mut self, level: Level, message: &str) -> Result<()>; fn local_cache_get(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>; fn local_cache_set(&mut self, key: &[u8], value: &[u8]) -> Result<()>; fn local_cache_set_expiration(
        &mut self,
        key: &[u8],
        expire_after_secs: u64
    ) -> Result<()>; fn local_cache_remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>; fn create_input_channel(&mut self, ch: InputChannel) -> Result<i32>;
}
Expand description

All ocall definitions for pink Sidevm.

Required Methods

Close given resource by id.

Poll given resource by id and return a dynamic sized data.

Poll given resource to read data. Low level support for AsyncRead.

Poll given resource to write data. Low level support for AsyncWrite.

Shutdown a socket

Poll given resource to generate a new resource id.

Mark a task as ready for next polling

Get the next waken up task id.

Enable logging for ocalls

Get awake wakers

Get random number

Create a timer given a duration of time in milliseconds.

Send data to a oneshot channel.

Percentage of the gas remaining to the next breath

Create a TCP socket, bind to given address and listen to incoming connections.

If tls_config is not None, then the socket will be TLS encrypted. Invoke tcp_accept on the returned resource_id to accept incoming connections.

Accept incoming TCP connections.

Accept incoming TCP connections without returning the remote address.

Initiate a TCP connection to a remote endpoint.

Initiate a TLS/TCP connection to a remote endpoint.

Print log message.

Get value from the local cache.

Set value to the local cache.

Set expiration time for a key in the local cache.

Remove a value from the local cache.

Returns the previous value if it existed.

Create input channel

Implementors