pub struct AsyncApiSpec {
pub asyncapi: String,
pub info: Info,
pub servers: Option<HashMap<String, Server>>,
pub channels: Option<HashMap<String, Channel>>,
pub operations: Option<HashMap<String, Operation>>,
pub components: Option<Components>,
}Expand description
AsyncAPI 3.0 Specification
Root document object representing a complete AsyncAPI specification.
This is the top-level object that contains all information about an API, including servers, channels, operations, and reusable components.
§Example
use asyncapi_rust_models::*;
let spec = AsyncApiSpec {
asyncapi: "3.0.0".to_string(),
info: Info {
title: "My WebSocket API".to_string(),
version: "1.0.0".to_string(),
description: Some("Real-time messaging API".to_string()),
},
servers: None,
channels: None,
operations: None,
components: None,
};Fields§
§asyncapi: StringAsyncAPI version (e.g., “3.0.0”)
info: InfoGeneral information about the API
servers: Option<HashMap<String, Server>>Server connection details
channels: Option<HashMap<String, Channel>>Available channels (communication paths)
operations: Option<HashMap<String, Operation>>Operations (send/receive)
components: Option<Components>Reusable components (messages, schemas, etc.)
Trait Implementations§
Source§impl Clone for AsyncApiSpec
impl Clone for AsyncApiSpec
Source§fn clone(&self) -> AsyncApiSpec
fn clone(&self) -> AsyncApiSpec
Returns a duplicate of the value. Read more
1.0.0 · 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 AsyncApiSpec
impl Debug for AsyncApiSpec
Source§impl Default for AsyncApiSpec
impl Default for AsyncApiSpec
Source§fn default() -> AsyncApiSpec
fn default() -> AsyncApiSpec
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AsyncApiSpec
impl<'de> Deserialize<'de> for AsyncApiSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AsyncApiSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AsyncApiSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AsyncApiSpec
impl Serialize for AsyncApiSpec
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 AsyncApiSpec
impl RefUnwindSafe for AsyncApiSpec
impl Send for AsyncApiSpec
impl Sync for AsyncApiSpec
impl Unpin for AsyncApiSpec
impl UnwindSafe for AsyncApiSpec
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