Skip to main content

OpenApiDoc

Struct OpenApiDoc 

Source
pub struct OpenApiDoc {
    pub components: Components,
}
Expand description

Top-level OpenAPI v3 document. We only deserialize the components section we use — the rest is left as raw JSON.

Fields§

§components: Components

Sub-section with the resource type definitions.

Implementations§

Source§

impl OpenApiDoc

Source

pub fn load(path: &Path) -> Result<Self>

Load + parse an OpenAPI v3 JSON file.

§Errors

Forwards parse errors with context including the file path.

Source

pub fn shape(&self, openapi_key: &str) -> Result<&KindShape>

Find the KindShape for openapi_key, or error.

§Errors

Returns an error mentioning the key when absent.

Trait Implementations§

Source§

impl Debug for OpenApiDoc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OpenApiDoc

Source§

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 Forget for OpenApiDoc

§

impl Freeze for OpenApiDoc
where *const LeafNode<String, KindShape> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, KindShape)>>: Freeze,

§

impl Move for OpenApiDoc

§

impl RefUnwindSafe for OpenApiDoc

§

impl Send for OpenApiDoc
where NodeRef<Owned, String, KindShape, LeafOrInternal>: Send, BoxRaw<(String, KindShape)>: Send,

§

impl Sync for OpenApiDoc
where NodeRef<Owned, String, KindShape, LeafOrInternal>: Sync, BoxRaw<(String, KindShape)>: Sync,

§

impl Unpin for OpenApiDoc
where *const LeafNode<String, KindShape> is !null: Unpin, Box<(String, KindShape)>: Unpin,

§

impl UnsafeUnpin for OpenApiDoc
where *const LeafNode<String, KindShape> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, KindShape)>>: UnsafeUnpin,

§

impl UnwindSafe for OpenApiDoc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.