pub struct ComponentProperties {
pub component: Cow<'static, str>,
pub properties: fn() -> Vec<(String, Schema, bool)>,
}Expand description
Properties a module adds at run time to the values of one component
schema, so the OpenAPI document lists them too. navree-auth’s user
resource extensions add fields to UserResource this way (an app’s
roles, say).
A module contributes it (ModuleBuilder::contribute), and navree-api
applies every one to the document’s components: each
property goes after the type’s own, and one of the same name replaces the
type’s, as an extension may overwrite a field. A document without the
component is left as it is.
Fields§
§component: Cow<'static, str>The component’s name (UserResource).
properties: fn() -> Vec<(String, Schema, bool)>Each property’s name and schema, and whether every value has it.
Implementations§
Trait Implementations§
Source§impl Clone for ComponentProperties
impl Clone for ComponentProperties
Auto Trait Implementations§
impl Forget for ComponentProperties
impl Freeze for ComponentProperties
impl Move for ComponentProperties
impl RefUnwindSafe for ComponentProperties
impl Send for ComponentProperties
impl Sync for ComponentProperties
impl Unpin for ComponentProperties
impl UnsafeUnpin for ComponentProperties
impl UnwindSafe for ComponentProperties
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