pub struct DefaultConventions;Expand description
This project’s conventions.
Filters names its types after the struct’s pascal-case segments, the
last one being the layer’s suffix (OrderModel → OrdersQueryModel,
OrderSortFieldModel, …; OrderDto → OrdersQueryParams, …), so the
struct’s name needs at least two segments, as does a model deriving
MergePatch. A merge patch struct is named MergePatch…
(MergePatchOrderModel), and a wrapper is pascal cased.
The runtime crates keep their default, absolute paths (::queryweave,
…).
A sort variant is its field pascal cased (delivery_date →
DeliveryDate), and a filter field is its field followed by the operator
(username_sw), except bool, which keeps the bare field (is_active).
Trait Implementations§
Source§impl Conventions for DefaultConventions
impl Conventions for DefaultConventions
Source§fn filters_names(input: &Ident) -> Result<FiltersNames>
fn filters_names(input: &Ident) -> Result<FiltersNames>
Source§fn check_model_name(name: &Ident) -> Result<()>
fn check_model_name(name: &Ident) -> Result<()>
Check the name of a model deriving
MergePatch. Read moreSource§fn check_merge_patch_name<S: ToTokens + ?Sized>(
name: &Ident,
span: &S,
what: &str,
) -> Result<()>
fn check_merge_patch_name<S: ToTokens + ?Sized>( name: &Ident, span: &S, what: &str, ) -> Result<()>
Check the name of a merge patch struct: the struct a derive is placed
on (
MergePatchNullableFields, ValidateNonNullable), or one an
attribute links to (#[merge_patch(patch = path)], or
#[validate_non_nullable(mirrors = path)]), calling it
what. Read moreSource§fn sort_variant(field: &Ident, span: Span) -> Ident
fn sort_variant(field: &Ident, span: Span) -> Ident
The variant of the generated sortable-fields enum for the
#[sortable]
field field, spanned to span. Read moreSource§fn filter_field(field: &Ident, operator: &str, span: Span) -> Ident
fn filter_field(field: &Ident, operator: &str, span: Span) -> Ident
The generated filter field (and, on a DTO, query parameter) filtering
field with the operator written operator in #[filter(...)] (lt,
eq, gt, sw, c, ew or bool), spanned to span. Read moreSource§fn check_wrapper_name<S: ToTokens + ?Sized>(
name: &Ident,
span: &S,
what: &str,
) -> Result<()>
fn check_wrapper_name<S: ToTokens + ?Sized>( name: &Ident, span: &S, what: &str, ) -> Result<()>
Check the name of a wrapper an attribute links to
(
#[append_to_query(filters = path)] of AppendToQuery), calling it
what. Read moreSource§fn core_crate() -> Path
fn core_crate() -> Path
The path of the core runtime crate, named by the code generated for a
root model (
Filters, MergePatch, MergePatchNullableFields,
RawValue). Read moreSource§fn api_crate() -> Path
fn api_crate() -> Path
The path of the API runtime crate, named by the code generated for an
API type (a
Filters mirror with serde or utoipa,
ValidateNonNullable). Defaults to ::queryweave_api.Source§fn sql_crate() -> Path
fn sql_crate() -> Path
The path of the SQL runtime crate, named by the code generated for the
persistence layer (
Columns, AppendToQuery,
AppendConditions). Defaults to ::queryweave_sql.Source§fn integrations() -> Vec<&'static dyn Integration>
fn integrations() -> Vec<&'static dyn Integration>
The integrations a
Filters mirror may opt into, each with the flag
of #[filters(...)] named after it, in the order their additions are
generated. Their names must differ from each other and from mirrors. Read moreAuto Trait Implementations§
impl Freeze for DefaultConventions
impl RefUnwindSafe for DefaultConventions
impl Send for DefaultConventions
impl Sync for DefaultConventions
impl Unpin for DefaultConventions
impl UnsafeUnpin for DefaultConventions
impl UnwindSafe for DefaultConventions
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