An open API service indexing awesome lists of open source software.

https://github.com/rggh/log_buffer

Log Buffer in Rust
https://github.com/rggh/log_buffer

buffer dequeue rust

Last synced: 4 months ago
JSON representation

Log Buffer in Rust

Awesome Lists containing this project

README

          

# Log Buffer (in Rust 🦀)

- uses double ended queue
- use to_owned() to avoid lifetime issues

---

Data Structure:

VecDeque is used because it efficiently supports adding/removing elements from both ends.

Capacity Handling:

When the buffer reaches its capacity, the oldest log is removed using pop_front.

Adding Logs:

New logs are added to the end with push_back.

Retrieving Logs:

get_logs returns a vector containing all the logs in order.