Struct hypers_openapi::PathItem
source · #[non_exhaustive]pub struct PathItem {
pub summary: Option<String>,
pub description: Option<String>,
pub servers: Servers,
pub parameters: Parameters,
pub operations: Operations,
}Expand description
Implements OpenAPI Path Item Object what describes Operations available on
a single path.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.summary: Option<String>Optional summary intended to apply all operations in this PathItem.
description: Option<String>Optional description intended to apply all operations in this PathItem.
Description supports markdown syntax.
servers: ServersAlternative Server array to serve all Operations in this PathItem overriding
the global server array.
parameters: ParametersList of Parameters common to all Operations in this PathItem. Parameters cannot
contain duplicate parameters. They can be overridden in Operation level but cannot be
removed there.
operations: OperationsMap of operations in this PathItem. Operations can hold only one operation
per PathItemType.
Implementations§
source§impl PathItem
impl PathItem
sourcepub fn new<O: Into<Operation>>(
path_item_type: PathItemType,
operation: O,
) -> Self
pub fn new<O: Into<Operation>>( path_item_type: PathItemType, operation: O, ) -> Self
Construct a new PathItem with provided Operation mapped to given PathItemType.
sourcepub fn append(&mut self, other: &mut Self)
pub fn append(&mut self, other: &mut Self)
Moves all elements from other into self, leaving other empty.
If a key from other is already present in self, the respective
value from self will be overwritten with the respective value from other.
sourcepub fn add_operation<O: Into<Operation>>(
self,
path_item_type: PathItemType,
operation: O,
) -> Self
pub fn add_operation<O: Into<Operation>>( self, path_item_type: PathItemType, operation: O, ) -> Self
Append a new Operation by PathItemType to this PathItem. Operations can
hold only one operation per PathItemType.
sourcepub fn summary<S: Into<String>>(self, summary: S) -> Self
pub fn summary<S: Into<String>>(self, summary: S) -> Self
Add or change summary intended to apply all operations in this PathItem.
sourcepub fn description<S: Into<String>>(self, description: S) -> Self
pub fn description<S: Into<String>>(self, description: S) -> Self
Add or change optional description intended to apply all operations in this PathItem.
Description supports markdown syntax.
sourcepub fn servers<I: IntoIterator<Item = Server>>(self, servers: I) -> Self
pub fn servers<I: IntoIterator<Item = Server>>(self, servers: I) -> Self
sourcepub fn parameters<I: IntoIterator<Item = Parameter>>(
self,
parameters: I,
) -> Self
pub fn parameters<I: IntoIterator<Item = Parameter>>( self, parameters: I, ) -> Self
Trait Implementations§
source§impl<'de> Deserialize<'de> for PathItem
impl<'de> Deserialize<'de> for PathItem
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>,
source§impl PartialEq for PathItem
impl PartialEq for PathItem
impl StructuralPartialEq for PathItem
Auto Trait Implementations§
impl Freeze for PathItem
impl RefUnwindSafe for PathItem
impl Send for PathItem
impl Sync for PathItem
impl Unpin for PathItem
impl UnwindSafe for PathItem
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)