Skip to content

Commit 2388be1

Browse files
authored
feat: implement pagination for feature queries in API (#31)
1 parent aab09bc commit 2388be1

File tree

7 files changed

+435
-192
lines changed

7 files changed

+435
-192
lines changed

.cursor/rules/general.mdc

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: General rules about the project and coding guidelines
3-
globs:
3+
globs:
44
alwaysApply: true
55
---
66
# Important Rules for LLM
@@ -21,9 +21,10 @@ I am a specialized software engineer with a distinct characteristic: my memory r
2121

2222
## Memory Bank Structure
2323

24-
All files are stored under [productContext.md](mdc:.cursor/rules/memory/productContext.md), [progress.md](mdc:.cursor/rules/memory/progress.md), [specification.md](mdc:.cursor/rules/memory/specification.md) and `.cursor/memory/*`. The memory bank consists of mandatory core files and optional context files, all formatted in Markdown.
24+
All files are stored under [productContext.md](mdc:.cursor/rules/memory/productContext.md), [progress.md](mdc:.cursor/rules/memory/progress.md), [specification.md](mdc:.cursor/rules/memory/specification.md) and `.cursor/memory/*`. The memory bank consists of mandatory core files and optional context files, all formatted in Markdown.
2525

2626
### Core Files (Mandatory)
27+
2728
1. **`productContext.md`** [productContext.md](mdc:.cursor/rules/memory/productContext.md)
2829
- Explains the purpose of the project.
2930
- Identifies the problem it solves.
@@ -39,6 +40,7 @@ All files are stored under [productContext.md](mdc:.cursor/rules/memory/productC
3940
### Additional Context Files
4041

4142
Additional files and folders can be created inside `memory/rules/memory*` if they aid in organization:
43+
4244
- Documentation for complex features.
4345
- Integration specifications.
4446
- API documentation.
@@ -76,6 +78,7 @@ flowchart TD
7678
## Updating Documentation
7779

7880
Memory bank updates occur under the following conditions:
81+
7982
1. When a new project pattern is discovered.
8083
2. After implementing a significant change.
8184
3. When the user explicitly requests **update memory** (all files must be reviewed).
@@ -122,6 +125,7 @@ flowchart TD
122125
```
123126

124127
### Key Information to Record
128+
125129
- Critical implementation paths.
126130
- User preferences and workflows.
127131
- Project-specific patterns.
@@ -135,9 +139,11 @@ flowchart TD
135139

136140
- Memory is finite, so large files should not be loaded unnecessarily.
137141
- Before reading `*.json` or `*.jsonl`, check the file size with:
142+
138143
```bash
139144
ls -al <file>
140145
```
146+
141147
- If a conversation becomes too long, suggest updating the memory bank and closing the current context.
142148

143149
---
@@ -147,34 +153,40 @@ flowchart TD
147153
## Commit Best Practices
148154

149155
1. **Review Changes**
156+
150157
```bash
151158
git status
152159
git diff
153160
git log
154161
```
162+
155163
2. **Analyze Changes**
156164
- Identify modified or added files.
157165
- Understand the nature of changes (new feature, bug fix, refactoring, etc.).
158166
- Evaluate the impact on the project.
159167
- Ensure no sensitive information is exposed.
160168
3. **Create Meaningful Commit Messages**
169+
161170
```bash
162171
git commit -m "fix: Resolve issue with authentication timeout"
163172
```
164173

165174
## Pull Request Best Practices
166175

167176
1. **Review Branch Status**
177+
168178
```bash
169179
git status
170180
git diff main...HEAD
171181
git log
172182
```
183+
173184
2. **Analyze Changes**
174185
- Review all commits made since branching off `main`.
175186
- Assess change scope and impact.
176187
- Ensure no sensitive data is committed.
177188
3. **Create a Pull Request**
189+
178190
```bash
179191
gh pr create --title "feat: Improve Rust error handling" --body "Improved error handling with Result<T, E>."
180192
```
@@ -183,10 +195,9 @@ flowchart TD
183195

184196
# Local MCP
185197

186-
## `readUrl`
198+
## `serena`
187199

188-
- Reads an article and extracts the main content.
189-
- If the user asks to research a topic that is unknown, request a URL.
200+
- `serena` is a tool that can be used to get overview of the code base.
190201

191202
---
192203

@@ -199,11 +210,7 @@ flowchart TD
199210
- Prefer functions over structs when internal state is unnecessary.
200211
- Use adapters to abstract dependencies and facilitate testing.
201212

202-
## Error Handling
203-
204-
- Use `Result<T, E>` for error management.
205-
- Define specific error types.
206-
- Ensure exhaustive error handling.
213+
## Error
207214

208215
## Implementation Patterns
209216

.cursor/rules/memory/tdd-rust-guidelines.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

.cursor/rules/rust.mdc

Lines changed: 11 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ alwaysApply: true
66
# Rust Coding Guidelines for Library Development
77

88
## General Principles
9+
910
- Write **idiomatic Rust** code that is clear, efficient, and maintainable.
1011
- Prioritize **safety, performance, and modularity**.
1112
- Follow **Rust’s naming conventions**:
@@ -20,111 +21,16 @@ alwaysApply: true
2021

2122
---
2223

23-
## Project Structure
24-
- The Rust codebase consists of **multiple crates** and their modules.
25-
- Organize the library using Rust’s standard `src/lib.rs` format.
26-
- Place implementation details inside separate modules within `src/`.
27-
- Keep `lib.rs` minimal, exposing only the public API.
28-
- Use `mod.rs` for submodules when necessary.
29-
- Follow **Cargo best practices** for managing dependencies and features.
30-
31-
### Example Folder Structure
32-
```
33-
.
34-
├── bst
35-
│   └── src
36-
│   ├── byte_serializable.rs
37-
│   ├── error.rs
38-
│   ├── lib.rs
39-
│   ├── query
40-
│   │   ├── common.rs
41-
│   │   ├── fs.rs
42-
│   │   ├── http.rs
43-
│   │   ├── mod.rs
44-
│   │   └── stream.rs
45-
│   └── sorted_index.rs
46-
├── btree
47-
│   └── src
48-
│   ├── entry.rs
49-
│   ├── errors.rs
50-
│   ├── http.rs
51-
│   ├── key.rs
52-
│   ├── lib.rs
53-
│   ├── node.rs
54-
│   ├── query.rs
55-
│   ├── storage.rs
56-
│   ├── stream.rs
57-
│   └── tree.rs
58-
├── cli
59-
│   └── src
60-
│   └── main.rs
61-
├── fcb_core
62-
│   ├── benches
63-
│   │   ├── read.rs
64-
│   │   ├── read_attr.rs
65-
│   │   └── read_profile.rs
66-
│   ├── benchmark_data
67-
│   │   └── attribute
68-
│   ├── scripts
69-
│   └── src
70-
│   ├── bin
71-
│   │   ├── read.rs
72-
│   │   ├── read_attr.rs
73-
│   │   ├── read_attr_stream.rs
74-
│   │   ├── read_cj.rs
75-
│   │   └── write.rs
76-
│   ├── cj_utils.rs
77-
│   ├── cjerror.rs
78-
│   ├── const_vars.rs
79-
│   ├── error.rs
80-
│   ├── fb
81-
│   │   ├── feature_generated.rs
82-
│   │   ├── header_generated.rs
83-
│   │   └── mod.rs
84-
│   ├── http_reader
85-
│   │   ├── mock_http_range_client.rs
86-
│   │   └── mod.rs
87-
│   ├── lib.rs
88-
│   ├── reader
89-
│   │   ├── attr_query.rs
90-
│   │   ├── city_buffer.rs
91-
│   │   ├── deserializer.rs
92-
│   │   ├── geom_decoder.rs
93-
│   │   └── mod.rs
94-
│   └── writer
95-
│   ├── attr_index.rs
96-
│   ├── attribute.rs
97-
│   ├── error.rs
98-
│   ├── feature_writer.rs
99-
│   ├── geom_encoder.rs
100-
│   ├── header_writer.rs
101-
│   ├── mod.rs
102-
│   └── serializer.rs
103-
├── packed_rtree
104-
│   └── src
105-
│   ├── error.rs
106-
│   └── lib.rs
107-
├── src
108-
│   └── lib.rs
109-
├── temp
110-
└── wasm
111-
├── pkg
112-
└── src
113-
├── gloo_client.rs
114-
└── lib.rs
115-
116-
```
117-
118-
---
119-
12024
## Error Handling
25+
12126
- Use `thiserror` to make custom error for package-level errors. You shouldn't use `anyhow` unless I explictly approve you to do that.
12227
- Avoid panics in library code; return errors instead.
12328
- Handle errors and edge cases early, returning errors where appropriate.
12429

12530
---
12631

12732
## Performance Optimization
33+
12834
- Use **iterators instead of loops** for better performance and readability.
12935
- Minimize memory allocations by using **borrowed references (`&str`, `&[u8]`)** where possible.
13036
- Optimize for **human readability** while maintaining machine efficiency.
@@ -133,6 +39,7 @@ alwaysApply: true
13339
---
13440

13541
## Async Programming
42+
13643
- Use `tokio` as the async runtime.
13744
- Prefer **channels over mutexes** where applicable.
13845
- Implement **structured concurrency** using `tokio::select!`.
@@ -142,33 +49,40 @@ alwaysApply: true
14249
---
14350

14451
## API Design
52+
14553
- Follow **Rust’s API guidelines** for public interfaces.
14654
- Use **builder patterns** for complex configurations.
14755

14856
---
14957

15058
## Testing
59+
15160
- Write **unit tests** with `#[cfg(test)]`.
15261
- Use **integration tests** for public APIs in the `tests/` directory.
15362
- Mock external dependencies where necessary.
15463
- Use `tokio::test` for as
15564
mentation
15665
- Write **Rustdoc** comments for public functions and structs.
15766
- Include examples in preview document
67+
15868
---
15969

16070
## Dependency Management
71+
16172
- Use `cargo-audit` to che**minimal and up-to-date**.
73+
- Add crates to workspace's `Cargo.toml` file. Don't add them to individual crates' `Cargo.toml` files.
16274

16375
---
16476

16577
## Logging and Debugging
78+
16679
- Use `tracing` for structured logging.
16780
- Enable debug assertions wit_assert!()`.
16881

16982
---
17083

17184
## Final Notes
85+
17286
- Follow **Rust's idiomatic coding practices**.
17387
- Endut e, safety, and maintainability**.
17488
- Maintain a **black-and-white, pixelated/nerdy ltao will remain robust, efficient, and maintainable across its m crates and modules. 🚀

0 commit comments

Comments
 (0)