StdioTransport

Struct StdioTransport 

Source
pub struct StdioTransport { /* private fields */ }
Expand description

Standard I/O transport implementation

§Interior Mutability Architecture

Following research-backed 2025 Rust async best practices:

  • state: std::sync::Mutex (short-lived locks, never held across .await)
  • config: std::sync::Mutex (infrequent updates, short-lived locks)
  • metrics: AtomicMetrics (lock-free counters, 10-100x faster than Mutex)
  • I/O streams: tokio::sync::Mutex (held across .await, necessary for async I/O)

Implementations§

Source§

impl StdioTransport

Source

pub fn new() -> StdioTransport

Create a new stdio transport

Source

pub fn with_config(config: TransportConfig) -> StdioTransport

Create a stdio transport with custom configuration

Source

pub fn with_event_emitter( event_emitter: TransportEventEmitter, ) -> StdioTransport

Create a stdio transport with event emitter

Trait Implementations§

Source§

impl Debug for StdioTransport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for StdioTransport

Source§

fn default() -> StdioTransport

Returns the “default value” for a type. Read more
Source§

impl Transport for StdioTransport

Source§

fn transport_type(&self) -> TransportType

Returns the type of this transport.
Source§

fn capabilities(&self) -> &TransportCapabilities

Returns the capabilities of this transport.
Source§

fn state<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = TransportState> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Returns the current state of the transport.
Source§

fn connect<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Establishes a connection to the remote endpoint.
Source§

fn disconnect<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Closes the connection to the remote endpoint.
Source§

fn send<'life0, 'async_trait>( &'life0 self, message: TransportMessage, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Sends a single message over the transport.
Source§

fn receive<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<TransportMessage>, TransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Receives a single message from the transport in a non-blocking way.
Source§

fn metrics<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = TransportMetrics> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Returns a snapshot of the transport’s current performance metrics.
Source§

fn endpoint(&self) -> Option<String>

Returns the endpoint address or identifier for this transport, if applicable.
Source§

fn configure<'life0, 'async_trait>( &'life0 self, config: TransportConfig, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait, StdioTransport: 'async_trait,

Applies a new configuration to the transport.
Source§

fn is_connected<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns true if the transport is currently in the Connected state.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more