pub struct ApiDoc {
pub openapi: Arc<OpenApi>,
pub spec_json: Bytes,
}Expand description
Immutable, in-memory OpenAPI document with its serialized JSON form
pre-rendered into a Bytes buffer.
Cloning is cheap (Bytes is reference-counted, openapi is wrapped
in Arc). The JSON is serialized exactly once when
ApiDocBuilder::build is called and shared across all subsequent
reads — handlers built by crate::mount_docs hand the same
Bytes to every response with zero copying.
Fields§
§openapi: Arc<OpenApi>The structured OpenAPI document.
spec_json: BytesThe serialized JSON form of Self::openapi, pre-rendered for
zero-copy serving from memory.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ApiDoc
impl RefUnwindSafe for ApiDoc
impl Send for ApiDoc
impl Sync for ApiDoc
impl Unpin for ApiDoc
impl UnsafeUnpin for ApiDoc
impl UnwindSafe for ApiDoc
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