pub struct ServerVariable {
pub description: Option<String>,
pub default: Option<String>,
pub enum_values: Option<Vec<String>>,
pub examples: Option<Vec<String>>,
}Expand description
Server variable definition
Defines a variable that can be used in the server pathname. Variables are substituted at runtime with actual values.
§Example
use asyncapi_rust_models::ServerVariable;
let user_id_var = ServerVariable {
description: Some("Authenticated user ID".to_string()),
default: None,
enum_values: None,
examples: Some(vec!["12".to_string(), "13".to_string()]),
};Fields§
§description: Option<String>Variable description
Human-readable description of what this variable represents
default: Option<String>Default value
The default value to use if no value is provided
enum_values: Option<Vec<String>>Enumeration of allowed values
If specified, only these values are valid for this variable
examples: Option<Vec<String>>Example values
A list of example values for documentation purposes
Trait Implementations§
Source§impl Clone for ServerVariable
impl Clone for ServerVariable
Source§fn clone(&self) -> ServerVariable
fn clone(&self) -> ServerVariable
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 ServerVariable
impl Debug for ServerVariable
Source§impl<'de> Deserialize<'de> for ServerVariable
impl<'de> Deserialize<'de> for ServerVariable
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerVariable, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerVariable, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ServerVariable
impl Serialize for ServerVariable
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 ServerVariable
impl RefUnwindSafe for ServerVariable
impl Send for ServerVariable
impl Sync for ServerVariable
impl Unpin for ServerVariable
impl UnwindSafe for ServerVariable
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