Skip to main content
Version: 0.1.0

Embedded targets and I/O

This page summarizes how the Rust workspace supports no_std, bare-metal style builds, and transport integration.

Feature flags (all library crates)

FeatureMeaning
std (default)Full standard library; file helpers and std::error::Error impls where applicable.
alloc (default)Heap types (Vec, String) for cryptographic and protocol buffers.

Disable defaults for bare-metal style builds:

cargo check -p noxtls --no-default-features --features alloc

std-only APIs

When std is disabled, the following are unavailable (use in-memory / slice APIs instead):

CrateAPI
noxtls-coreLibraryConfig::from_mbedtls_style_file — use from_mbedtls_style_str with bytes you loaded.
noxtls-x509pem_file_to_der, pem_file_to_der_blocks, der_to_pem_file, der_to_file.
noxtlsTicketStore::save_to_file, TicketStore::load_from_file.

TLS transport (noxtls)

The transport module defines:

  • transport::blocking::BlockingStream — synchronous read/write.
  • transport::stream_async::AsyncByteStream — async read/write (uses async_trait(?Send) for embedded-io-async compatibility).

Optional Cargo features on noxtls (forwarded to noxtls-io):

FeaturePurpose
adapter-embedded-ioEmbeddedIoTransport wrapping embedded-io Read + Write.
adapter-embedded-io-asyncEmbeddedIoAsyncTransport wrapping embedded-io-async.
adapter-tokioTokioAsyncTransport for tokio types with AsyncReadExt + AsyncWriteExt (implies std).

Example checks:

cargo check -p noxtls --features adapter-embedded-io
cargo check -p noxtls --features adapter-embedded-io-async
cargo check -p noxtls --features adapter-tokio

Handshake helpers

transport::drive::read_exact_blocking reads a fixed number of bytes through a BlockingStream for framing layers built on top of the protocol state machine.