pub struct CompiledSchema(/* private fields */);Expand description
A compiled schema as the server sees it: the handle route input
declarations are compiled into.
Implementations§
Source§impl CompiledSchema
impl CompiledSchema
Sourcepub fn has_file_rules(&self) -> bool
pub fn has_file_rules(&self) -> bool
Whether any field (at any depth) is a file rule.
Sourcepub fn field_names(&self) -> Vec<&str>
pub fn field_names(&self) -> Vec<&str>
The declared top-level field names.
Sourcepub fn is_array_field(&self, name: &str) -> bool
pub fn is_array_field(&self, name: &str) -> bool
Whether a top-level field is an array (repeated text keys collect into it).
Sourcepub fn is_file_field(&self, name: &str) -> bool
pub fn is_file_field(&self, name: &str) -> bool
Whether a top-level field (or an array of them) is a file rule.
Sourcepub fn file_max_bytes(&self, name: &str) -> Option<u64>
pub fn file_max_bytes(&self, name: &str) -> Option<u64>
The max_bytes of a top-level file rule (or of the items of an
array of files), so the spooler can stop at the rule’s own bound.
Sourcepub fn title(&self) -> Option<&str>
pub fn title(&self) -> Option<&str>
The component name (nitr.validate.schema(fields, { title = … })),
when the schema has one.
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 of the rules, for the OpenAPI document: a
titled schema is registered in components and returned as a
$ref (a title two different schemas claim gets a numbered suffix
for the later one), an untitled one comes back inline.
Trait Implementations§
Source§impl Clone for CompiledSchema
impl Clone for CompiledSchema
Auto Trait Implementations§
impl !RefUnwindSafe for CompiledSchema
impl !UnwindSafe for CompiledSchema
impl Freeze for CompiledSchema
impl Send for CompiledSchema
impl Sync for CompiledSchema
impl Unpin for CompiledSchema
impl UnsafeUnpin for CompiledSchema
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
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> ⓘ
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> ⓘ
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