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:
- Orchestration - creating channels, managing processes, etc.
- 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.
- Client
Config Builder - Configures a
Clientconnection to the runtime. - Process
- Handle to a running process in the runtime.
- Process
Builder - 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.
- AbiScalar
Type - Protocol types shared with the remote client control plane. Scalar kinds that can be part of an ABI signature.
- AbiScalar
Value - 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.
- Client
Error - Errors returned by the Selium client.
- Entrypoint
Arg - 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§
- Guest
Resource Id - Protocol types shared with the remote client control plane. Guest-facing resource identifiers.
- Guest
Uint - Protocol types shared with the remote client control plane. Guest pointer-sized unsigned integer.