Skip to main content

Crate selium_remote_client

Crate selium_remote_client 

Source
Expand description

External client library for interacting with Selium runtimes and their guests.

You should use this library in code that does not run on a Selium runtime. You should not use this library in code that does run on a Selium runtime.

This library can be used for:

  1. Orchestration - creating channels, managing processes, etc.
  2. Data I/O - publishing payloads, calling RPC servers, etc.

§Examples

use futures::{SinkExt, StreamExt, pin_mut};
use selium_remote_client::{Channel, ClientConfigBuilder, ClientError};

#[tokio::main]
async fn main() -> Result<(), ClientError> {
    let client = ClientConfigBuilder::default().connect().await?;
    let chunk_size = 64 * 1024;
    let channel = Channel::create(&client, chunk_size).await?;

    let mut publisher = channel.publish().await?;
    publisher.send(b"ping".to_vec()).await?;

    let mut subscriber = channel.subscribe(chunk_size).await?;
    pin_mut!(subscriber);
    if let Some(frame) = subscriber.next().await {
        let payload = frame?;
        eprintln!("received {} bytes", payload.len());
    }

    Ok(())
}

Structs§

AbiSignature
Protocol types shared with the remote client control plane. Description of a guest entrypoint’s parameters and results.
Channel
Data pipelines that transmit bytes bidirectionally.
Client
Connection to a Selium runtime.
ClientConfigBuilder
Configures a Client connection to the runtime.
Process
Handle to a running process in the runtime.
ProcessBuilder
Configures a process to be launched in the runtime.
Publisher
Sink that drains payloads into the channel.
Subscriber
Stream of payloads read from a channel.

Enums§

AbiParam
Protocol types shared with the remote client control plane. Logical parameter kinds supported by the ABI.
AbiScalarType
Protocol types shared with the remote client control plane. Scalar kinds that can be part of an ABI signature.
AbiScalarValue
Protocol types shared with the remote client control plane. Scalar value kinds supported by the ABI.
Capability
Protocol types shared with the remote client control plane. Kernel capability identifiers shared between host and guest.
ClientError
Errors returned by the Selium client.
EntrypointArg
Protocol types shared with the remote client control plane. Argument supplied to a process entrypoint.

Constants§

DEFAULT_DOMAIN
Default domain exposed by the remote-client guest.
DEFAULT_PORT
Default port exposed by the remote-client guest.
DEFAULT_RESPONSE_LIMIT
Maximum size allowed for RPC server replies.

Type Aliases§

GuestResourceId
Protocol types shared with the remote client control plane. Guest-facing resource identifiers.
GuestUint
Protocol types shared with the remote client control plane. Guest pointer-sized unsigned integer.