pub struct OpenApiBuilder { /* private fields */ }Expand description
OpenAPI 构建器
封装 utoipa::OpenApi 构建过程,提供链式 API。
Implementations§
Source§impl OpenApiBuilder
impl OpenApiBuilder
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
设置描述
Sourcepub fn to_json(self) -> Result<String, OpenApiError>
pub fn to_json(self) -> Result<String, OpenApiError>
构建并序列化为 JSON
Sourcepub fn validate(self) -> Result<(), OpenApiError>
pub fn validate(self) -> Result<(), OpenApiError>
验证 OpenAPI spec
Auto Trait Implementations§
impl Freeze for OpenApiBuilder
impl RefUnwindSafe for OpenApiBuilder
impl Send for OpenApiBuilder
impl Sync for OpenApiBuilder
impl Unpin for OpenApiBuilder
impl UnsafeUnpin for OpenApiBuilder
impl UnwindSafe for OpenApiBuilder
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