Skip to main content

Crate turbomcp_transport_traits

Crate turbomcp_transport_traits 

Source
Expand description

§TurboMCP Transport Traits

Core transport traits and types for the TurboMCP Model Context Protocol SDK. This crate provides the foundational abstractions that all transport implementations depend on.

§Overview

This crate defines:

§Usage

Transport implementations should depend on this crate and implement the Transport trait:

use turbomcp_transport_traits::{Transport, TransportResult, TransportMessage};

struct MyTransport { /* ... */ }

impl Transport for MyTransport {
    fn transport_type(&self) -> TransportType { /* ... */ }
    // ... other trait methods
}

Structs§

AtomicMetrics
A lock-free, atomic structure for high-performance metrics updates.
ConnectionState
Connection state for bidirectional communication
CorrelationContext
Correlation context for request-response patterns
LimitsConfig
Configuration for request and response size limits.
TimeoutConfig
Configuration for request and operation timeouts.
TlsConfig
TLS/HTTPS configuration for secure transport connections.
TransportCapabilities
Describes the capabilities of a transport implementation.
TransportConfig
Configuration for a transport instance.
TransportEventEmitter
An emitter for broadcasting TransportEvents to listeners.
TransportMessage
A wrapper for a message being sent or received over a transport.
TransportMessageMetadata
Metadata associated with a TransportMessage.
TransportMetrics
A serializable snapshot of a transport’s performance metrics.

Enums§

MessageDirection
Message direction in the transport layer
TlsVersion
TLS protocol version specification.
TransportError
Represents errors that can occur during transport operations.
TransportEvent
Represents events that occur within a transport’s lifecycle.
TransportState
Represents the current state of a transport connection.
TransportType
Enumerates the types of transports supported by the system.

Traits§

BidirectionalTransport
A trait for transports that support full-duplex, bidirectional communication.
StreamingTransport
A trait for transports that support streaming data.
Transport
The core trait for all transport implementations.
TransportFactory
A factory for creating instances of a specific transport type.

Functions§

validate_request_size
Validates that a request message size does not exceed the configured limit.
validate_response_size
Validates that a response message size does not exceed the configured limit.

Type Aliases§

TransportResult
A specialized Result type for transport operations.