pub struct Server {
pub url: String,
pub description: Option<String>,
pub variables: Option<BTreeMap<String, ServerVariable>>,
}Expand description
Server connectivity information.
Represents a server that provides connectivity to the target API.
The URL may contain variables enclosed in curly braces which are substituted
using values from the variables map.
§Example
use product_os_openapi::{Server, ServerVariable};
use std::collections::BTreeMap;
let mut variables = BTreeMap::new();
variables.insert("environment".to_owned(), ServerVariable {
default: "production".to_owned(),
enumeration: Some(vec!["production".to_owned(), "staging".to_owned()]),
description: Some("Environment name".to_owned()),
});
let server = Server {
url: "https://{environment}.example.com".to_owned(),
description: Some("Main API server".to_owned()),
variables: Some(variables),
};Fields§
§url: StringThe URL to the target host. May contain variables in curly braces.
description: Option<String>An optional description of the host. CommonMark syntax may be used.
variables: Option<BTreeMap<String, ServerVariable>>A map of variable name to its value substitution information.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Server
impl<'de> Deserialize<'de> for Server
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 Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin 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