pub struct OApi { /* private fields */ }
Expand description
§OpenApi document
This is the main struct of this crate. It contains a fully parsed OpenApi Document wrapped in a SparseRoot to allow for Sparse Pointer expansion.
Implementations§
Source§impl OApi
impl OApi
pub fn doc(&self) -> &SparseRoot<OApiDocument>
Methods from Deref<Target = SparseRoot<OApiDocument>>§
pub fn state(&self) -> &Rc<RefCell<SparseState>>
pub fn metadata(&self) -> &SparseMetadata
Sourcepub fn check_version(&self) -> Result<(), SparseError>
pub fn check_version(&self) -> Result<(), SparseError>
Get the value this selector is managing, either by deserializing the pointed value or by directly returning the owned value.
Sourcepub fn root_get(&self) -> Result<SparseValue<'_, S>, SparseError>
pub fn root_get(&self) -> Result<SparseValue<'_, S>, SparseError>
Get the value this selector is managing, either by deserializing the pointed value or by directly returning the owned value.
Sourcepub fn save_to_disk(
&self,
format: Option<SparseFileFormat>,
) -> Result<(), SparseError>
pub fn save_to_disk( &self, format: Option<SparseFileFormat>, ) -> Result<(), SparseError>
Save the state to disk in the specified format. If not format is specified, the format in which the document was read will be used. If the document was read from memory, it’ll be written in prettified JSON
Trait Implementations§
Source§impl Deref for OApi
impl Deref for OApi
Source§type Target = SparseRoot<OApiDocument>
type Target = SparseRoot<OApiDocument>
The resulting type after dereferencing.
Source§impl From<SparseRoot<OApiDocument>> for OApi
impl From<SparseRoot<OApiDocument>> for OApi
Source§fn from(doc: SparseRoot<OApiDocument>) -> Self
fn from(doc: SparseRoot<OApiDocument>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OApi
impl !RefUnwindSafe for OApi
impl !Send for OApi
impl !Sync for OApi
impl Unpin for OApi
impl !UnwindSafe for OApi
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