pub struct Parameter {
pub description: Option<String>,
pub default: Option<String>,
pub enum_values: Option<Vec<String>>,
pub examples: Option<Vec<String>>,
pub location: Option<String>,
}Expand description
Channel parameter definition
Defines a parameter that can be used in the channel address, following the AsyncAPI 3.0 Parameter Object.
Note: AsyncAPI 3.0 removed the schema property from Parameter (present in 2.x).
Parameters now use description, default, enum, examples, and location.
§Example
use asyncapi_rust_models::Parameter;
let user_id_param = Parameter {
description: Some("User ID for this WebSocket connection".to_string()),
default: Some("0".to_string()),
enum_values: None,
examples: Some(vec!["42".to_string(), "100".to_string()]),
location: None,
};Fields§
§description: Option<String>Human-readable description of what this parameter represents
default: Option<String>Default value for this parameter
enum_values: Option<Vec<String>>Enumeration of allowed values for this parameter
examples: Option<Vec<String>>Example values for this parameter
location: Option<String>Runtime expression specifying the location of the parameter value
See https://www.asyncapi.com/docs/reference/specification/v3.0.0#runtimeExpression
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Parameter
impl<'de> Deserialize<'de> for Parameter
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Parameter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Parameter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Parameter
impl Serialize for Parameter
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 Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin for Parameter
impl UnwindSafe for Parameter
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