Expand description
Implements OpenAPI Paths Object.
Holds relative paths to matching endpoints and operations. The path is appended to the url
from Server
object to construct a full url for endpoint.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.paths: BTreeMap<String, PathItem>
Implementations
sourceimpl Paths
impl Paths
sourcepub fn get_path_item<P: AsRef<str>>(&self, path: P) -> Option<&PathItem>
pub fn get_path_item<P: AsRef<str>>(&self, path: P) -> Option<&PathItem>
Return Option<&PathItem>
by given relative path if one exists
in Paths::paths
map. Otherwise will return None
.
sourcepub fn get_path_operation<P: AsRef<str>>(
&self,
path: P,
item_type: PathItemType
) -> Option<&Operation>
pub fn get_path_operation<P: AsRef<str>>(
&self,
path: P,
item_type: PathItemType
) -> Option<&Operation>
Return Option<&Operation>
from map of paths or None
if not found.
- First will try to find
PathItem
by given relative path. - Then tries to find
Operation
fromPathItem
’s operations by givenPathItemType
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Paths
impl<'de> Deserialize<'de> for Paths
sourcefn 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
sourceimpl From<Paths> for PathsBuilder
impl From<Paths> for PathsBuilder
sourceimpl From<PathsBuilder> for Paths
impl From<PathsBuilder> for Paths
sourcefn from(value: PathsBuilder) -> Self
fn from(value: PathsBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for Paths
impl Send for Paths
impl Sync for Paths
impl Unpin for Paths
impl UnwindSafe for Paths
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more