Improve model guide#515
Conversation
|
| Branch | elijah/model-docs-improve |
| Testbed | github-ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result microseconds (µs) (Result Δ%) | Upper Boundary microseconds (µs) (Limit %) |
|---|---|---|---|
| empty_router/empty_router | 📈 view plot 🚷 view threshold | 5,618.50 µs(-8.18%)Baseline: 6,118.81 µs | 7,662.80 µs (73.32%) |
| json_api/json_api | 📈 view plot 🚷 view threshold | 979.24 µs(-9.11%)Baseline: 1,077.34 µs | 1,318.23 µs (74.28%) |
| nested_routers/nested_routers | 📈 view plot 🚷 view threshold | 916.89 µs(-7.79%)Baseline: 994.40 µs | 1,200.43 µs (76.38%) |
| single_root_route/single_root_route | 📈 view plot 🚷 view threshold | 885.76 µs(-7.43%)Baseline: 956.85 µs | 1,163.46 µs (76.13%) |
| single_root_route_burst/single_root_route_burst | 📈 view plot 🚷 view threshold | 15,607.00 µs(-11.88%)Baseline: 17,711.61 µs | 21,188.15 µs (73.66%) |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
depends on cot-rs/cot-site#82 and cot-rs/cot-site#84 |
|
|
||
| ``` | ||
|
|
||
| ## Summary |
There was a problem hiding this comment.
Some pages have a Summary section while others don't. I'm not too sure which direction we'd want to go, but for the sake of consistency, do we require every page to have a Summary section? I, personally, am not a big fan, but I'm also indifferent if we have them or not
There was a problem hiding this comment.
I'm also indifferent if we have them or not, I'd just push on being consistent and having them everywhere or nowhere
There was a problem hiding this comment.
Got it, I'm leaning towards removing them, but I'm curious if @m4tx is fine with that or has a strong opinion against it
m4tx
left a comment
There was a problem hiding this comment.
Amazing stuff! There are some issues here and there - please make the changes before we can merge this.
Also, sometimes you put an additional newline after section headers, sometimes you do not - please make this consistent with the rest of the guides.
| #[derive(Debug, Clone)] | ||
| struct NewType(i32); | ||
|
|
||
| impl FromDbValue for NewType { |
There was a problem hiding this comment.
I'm not exactly happy with how closely tied this is to the specific database backend one can use. I would expect this to be changed in the future when we'll finally land the ORM refactor.
I think it's fine to keep it as-is because there's not much we can do about this for now, but just adding this as a general comment.

Restructure the Docs, starting with the model docs. I've improved the docs to mention a large number of features/functionalities we support. I've also split the docs to span across multiple pages in a subcategory, making it easier and nicer to follow. Currently, we have 2 pages (overview and queries) for Models. The overview section is a bit nuanced as it makes mention of the CotORM, setting up models, and configuring them.
There's also a section of Relationships which I believe deserves its own page once we have the M2M feature implemented(or we can still put this in its own page and show how to do this using an intermediate
throughModel).I would like to add another page for migrations, however, I'm keeping this PR ready at all times for review. Subsequent additions may or may not be included to this PR depending on when this gets merged
Related issue or discussion
Description
Type of change
Checklist
just test-all)just clippy)cargo fmt)