pub struct Server {
pub host: String,
pub protocol: String,
pub description: Option<String>,
}Expand description
Server connection information
Defines connection details for a server that hosts the API. Multiple servers can be defined to support different environments (production, staging, development).
§Example
use asyncapi_rust_models::Server;
let server = Server {
host: "chat.example.com:443".to_string(),
protocol: "wss".to_string(),
description: Some("Production WebSocket server".to_string()),
};Fields§
§host: StringServer URL or host
The hostname or URL where the server is hosted. May include port number. Examples: “localhost:8080”, “api.example.com”, “ws.example.com:443”
protocol: StringProtocol (e.g., “wss”, “ws”, “grpc”)
The protocol used to communicate with the server. Common values: “ws” (WebSocket), “wss” (WebSocket Secure), “grpc”, “mqtt”
description: Option<String>Server description
An optional human-readable description of the server’s purpose or environment
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Server
impl<'de> Deserialize<'de> for Server
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Server, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Server, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Server
impl Serialize for Server
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
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