Skip to main content

Crate conduit_core

Crate conduit_core 

Source
Expand description

§conduit-core

Binary IPC core for Tauri v2. Provides a binary codec, synchronous dispatch table, and in-process ring buffer for the conduit:// custom protocol.

§Dependency note

This crate depends on serde and sonic-rs unconditionally. These are required by the Router JSON handler methods, the ConduitHandler trait (which powers #[tauri_conduit::command]), and the Error::Serialize variant. The pure binary codec (Encode/Decode, RingBuffer, Queue) does not use JSON at runtime, but the types are not feature-gated because the handler system is considered a core part of conduit’s purpose.

Re-exports§

pub use channel::ChannelBuffer;
pub use codec::Bytes;
pub use codec::DRAIN_FRAME_OVERHEAD;
pub use codec::Decode;
pub use codec::Encode;
pub use codec::FRAME_HEADER_SIZE;
pub use codec::FrameHeader;
pub use codec::MsgType;
pub use codec::PROTOCOL_VERSION;
pub use codec::frame_pack;
pub use codec::frame_unpack;
pub use error::Error;
pub use handler::ConduitHandler;
pub use handler::HandlerContext;
pub use handler::HandlerResponse;
pub use queue::Queue;
pub use ringbuf::PushOutcome;
pub use ringbuf::RingBuffer;
pub use router::Router;

Modules§

channel
Unified channel buffer that wraps either a lossy or ordered strategy.
codec
Binary frame format and wire encoding traits for conduit.
error
Error types for the conduit IPC layer.
handler
Handler trait for conduit commands (sync and async).
queue
Bounded frame queue with guaranteed delivery.
ringbuf
In-process ring buffer for high-frequency streaming.
router
Command dispatch table with synchronous handlers.

Functions§

lock_or_recover
Acquire a Mutex lock, recovering from poison if another thread panicked while holding it.
read_or_recover
Acquire a RwLock read guard, recovering from poison.
write_or_recover
Acquire a RwLock write guard, recovering from poison.