pub struct Paths {
pub items: Map<PathItem>,
pub extensions: Extensions,
}Expand description
The available paths and the operations on each.
The specification lets this object carry extensions alongside its path
keys, so it is not a bare map: a #[serde(transparent)] newtype made an
x- member whose value was not a Path Item fail to parse outright. The
shape is Responses’ — patterned keys, extensions, and
a hand-written (de)serializer to tell them apart.
Fields§
§items: Map<PathItem>The Path Items, keyed by path template.
extensions: ExtensionsSpecification extensions.
Implementations§
Source§impl Paths
impl Paths
Sourcepub fn insert(
&mut self,
template: &PathTemplate,
item: PathItem,
) -> Option<PathItem>
pub fn insert( &mut self, template: &PathTemplate, item: PathItem, ) -> Option<PathItem>
Inserts a path item, replacing any existing entry for that template.
Sourcepub fn get(&self, template: &PathTemplate) -> Option<&PathItem>
pub fn get(&self, template: &PathTemplate) -> Option<&PathItem>
Looks up the path item for a template.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when nothing at all is declared.
Extensions count, for the reason
Responses::is_empty’s do: a Paths
Object carrying only x- fields still has something to write down.
Sourcepub fn declares_a_path(&self) -> bool
pub fn declares_a_path(&self) -> bool
Returns true when a path is declared.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Paths
impl<'de> Deserialize<'de> for Paths
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Paths
Auto Trait Implementations§
impl Freeze for Paths
impl RefUnwindSafe for Paths
impl Send for Paths
impl Sync for Paths
impl Unpin for Paths
impl UnsafeUnpin for Paths
impl UnwindSafe for Paths
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