pub struct ServiceDefinition {Show 15 fields
pub version: String,
pub description: String,
pub transport_type: ServiceTransportType,
pub command: Option<String>,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub cwd: Option<String>,
pub address: Option<String>,
pub port: Option<u16>,
pub timeout_secs: Option<u64>,
pub auto_reconnect: bool,
pub max_retries: Option<u32>,
pub heartbeat_interval_secs: Option<u64>,
pub capabilities: Vec<String>,
pub config: HashMap<String, Value>,
}Expand description
Service definition in configuration
Fields§
§version: StringService version
description: StringService description
transport_type: ServiceTransportTypeTransport type
command: Option<String>Command to execute (for stdio transport)
args: Vec<String>Command arguments
env: HashMap<String, String>Environment variables
cwd: Option<String>Working directory
address: Option<String>Network address (for TCP/WebSocket transport)
port: Option<u16>Port number (for TCP transport)
timeout_secs: Option<u64>Connection timeout in seconds
auto_reconnect: boolEnable auto-reconnect
max_retries: Option<u32>Maximum retry attempts
heartbeat_interval_secs: Option<u64>Heartbeat interval in seconds
capabilities: Vec<String>Capabilities provided by this service
config: HashMap<String, Value>Service-specific configuration
Implementations§
Source§impl ServiceDefinition
impl ServiceDefinition
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an environment variable
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set description
Sourcepub fn capability(self, cap: impl Into<String>) -> Self
pub fn capability(self, cap: impl Into<String>) -> Self
Add a capability
Sourcepub fn to_transport_config(&self) -> TransportConfig
pub fn to_transport_config(&self) -> TransportConfig
Convert to TransportConfig
Trait Implementations§
Source§impl Clone for ServiceDefinition
impl Clone for ServiceDefinition
Source§fn clone(&self) -> ServiceDefinition
fn clone(&self) -> ServiceDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceDefinition
impl Debug for ServiceDefinition
Source§impl Default for ServiceDefinition
impl Default for ServiceDefinition
Source§fn default() -> ServiceDefinition
fn default() -> ServiceDefinition
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ServiceDefinition
impl<'de> Deserialize<'de> for ServiceDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServiceDefinition
impl RefUnwindSafe for ServiceDefinition
impl Send for ServiceDefinition
impl Sync for ServiceDefinition
impl Unpin for ServiceDefinition
impl UnsafeUnpin for ServiceDefinition
impl UnwindSafe for ServiceDefinition
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