pub enum DocSchema {
Fields(CompiledSchema),
Rule(CompiledSchema),
}Expand description
A documentation-only schema, as a route’s doc.responses[n].schema
may give it: a compiled schema, a table of fields, or one rule table
({ type = "array", items = Note }). Never enforced; exported like a
request schema so the document reads the same on both halves.
Variants§
Fields(CompiledSchema)
An object schema: compiled, or a table of field rules.
Rule(CompiledSchema)
One rule, compiled as the single field value of a wrapper.
Implementations§
Source§impl DocSchema
impl DocSchema
Sourcepub fn json_schema(&self, components: &mut Components) -> Result<Value, String>
pub fn json_schema(&self, components: &mut Components) -> Result<Value, String>
The JSON Schema view, with the wrapper unwrapped for a rule.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DocSchema
impl !UnwindSafe for DocSchema
impl Freeze for DocSchema
impl Send for DocSchema
impl Sync for DocSchema
impl Unpin for DocSchema
impl UnsafeUnpin for DocSchema
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more