pub struct Server {
pub url: String,
pub name: Option<String>,
pub description: Option<String>,
pub variables: Map<ServerVariable>,
pub extensions: Extensions,
}Expand description
A server hosting the API.
Kynos never infers this from a bind address. The description states the public URL clients use, which is frequently not the socket the process listens on.
Fields§
§url: StringA URL to the target host, optionally templated with {variable}.
May be relative to the location the description is served from. Query string and fragment components are not permitted.
name: Option<String>A name for the server, for use by tooling.
Introduced in OpenAPI 3.2.
description: Option<String>A description of the host designated by the URL.
variables: Map<ServerVariable>A map between a variable name and its value, for URL substitution.
extensions: ExtensionsSpecification extensions.
Implementations§
Source§impl Server
impl Server
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn with_variable(
self,
name: impl Into<String>,
variable: ServerVariable,
) -> Self
pub fn with_variable( self, name: impl Into<String>, variable: ServerVariable, ) -> Self
Declares a substitution variable used in the URL template.
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
impl Eq for Server
impl StructuralPartialEq for Server
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.