Sha256: 585769bd6b34ff308331b2dc3b549678fb77e38c1ff22ce8f843a6d36f0fb47e

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

//! Adapters to/from other IO traits.
//!
//! To interoperate with other IO trait ecosystems, wrap a type in one of these
//! adapters.
//!
//! There's no separate adapters for Read/ReadBuf/Write traits. Instead, a single
//! adapter implements the right traits based on what the inner type implements.
//! This allows adapting a `Read+Write`, for example.

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
mod std_io;
#[cfg(feature = "std")]
pub use std_io::*;

#[cfg(feature = "futures")]
#[cfg_attr(docsrs, doc(cfg(feature = "futures")))]
mod futures_io;
#[cfg(feature = "futures")]
pub use futures_io::*;

#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
mod tokio;
#[cfg(feature = "tokio")]
pub use crate::adapters::tokio::*;

#[cfg(feature = "std")]
fn to_io_error<T: core::fmt::Debug>(err: T) -> std::io::Error {
    let kind = std::io::ErrorKind::Other;
    std::io::Error::new(kind, format!("{:?}", err))
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl crate::Error for std::io::Error {
    fn kind(&self) -> crate::ErrorKind {
        crate::ErrorKind::Other
    }
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-28.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-27.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-26.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-25.0.2 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-25.0.1 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-25.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-24.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-23.0.2 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-22.0.0 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs
wasmtime-21.0.1 ./ext/cargo-vendor/embedded-io-0.4.0/src/adapters/mod.rs