Expand description
Guest-side helpers for building Selium userland services.
Selium guests communicate exclusively via channels and typed hostcalls.
§Examples
use futures::{SinkExt, StreamExt};
use selium_userland::{entrypoint, io::DriverError};
// Services can return results.
#[entrypoint]
pub async fn result_service() -> Result<(), DriverError> {
Ok(())
}
// You can also define services that do not have return values.
#[entrypoint]
pub async fn void_service() {
()
}Re-exports§
pub use context::Context;pub use context::Dependency;pub use context::DependencyDescriptor;pub use rkyv;
Modules§
- abi
- Guest-facing helpers for working with Selium ABI metadata.
- context
- Guest environment handle for read-only lookups.
- encoding
- Flatbuffers-centric encoding helpers.
- fbs
- Generated Flatbuffers schema bindings.
- io
- High-level guest IO helpers for creating channels and moving raw frames.
- logging
- Guest-side tracing integration that forwards events onto a dedicated logging channel.
- net
- Guest-facing helpers for establishing and servicing network connections.
- process
- Guest-facing helpers for spawning and stopping Selium processes.
- singleton
- Guest helpers for registering and resolving singleton dependencies.
- time
- Guest-side time helpers.
Macros§
- dependency_
id - Re-export of Selium’s derive and attribute macros for guest crates. Compute a singleton dependency identifier from a string literal.
Structs§
- Dependency
Id - Re-export of singleton dependency identifiers. Stable identifier for a singleton dependency.
Traits§
Functions§
- block_
on - Block on a future using Selium’s guest-side executor.
- spawn
- Spawn a future so it can make progress alongside other guest tasks.
- yield_
now - Yield execution to the guest scheduler once.
Attribute Macros§
- entrypoint
- Re-export of Selium’s derive and attribute macros for guest crates.
- schema
- Re-export of Selium’s derive and attribute macros for guest crates. Struct-level schema annotation declaring a message type.