pub struct TransportFactory;Expand description
Factory for creating MCP transports from configuration.
Implementations§
Source§impl TransportFactory
impl TransportFactory
Sourcepub async fn create(
config: &McpServerConnectionConfig,
) -> Result<Arc<dyn McpTransport>, McpTransportError>
pub async fn create( config: &McpServerConnectionConfig, ) -> Result<Arc<dyn McpTransport>, McpTransportError>
Create a transport from a connection configuration.
Returns a boxed transport trait object that can be used for communication.
§Errors
Returns an error if:
- Stdio transport is missing command
- HTTP transport is missing URL
- Transport creation fails
Sourcepub fn is_supported(transport_type: TransportTypeId) -> bool
pub fn is_supported(transport_type: TransportTypeId) -> bool
Check if a transport type is supported.
Sourcepub fn supported_types() -> Vec<TransportTypeId>
pub fn supported_types() -> Vec<TransportTypeId>
List supported transport types.
Auto Trait Implementations§
impl Freeze for TransportFactory
impl RefUnwindSafe for TransportFactory
impl Send for TransportFactory
impl Sync for TransportFactory
impl Unpin for TransportFactory
impl UnwindSafe for TransportFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more