To improve the transaction log in the way the product team describes, it's a perfect fit for a skip list. How about ordering the commands by a u32 number—a millisecond offset from the initial timestamp. The commands it contains are going to be stored as strings associated with the offset.
Nevertheless, the list and its nodes need to be implemented.
Compared to previous implementations (especially since the singly linked list is a close relative), there are two major differences in this declaration. Firstly, the next pointer is an array, which is due to the node having a different successor at every level.
Secondly, the content was previously named value, but to differentiate between the timestamp offset and the actual content, value has been replaced by offset and command:
#[derive(Clone)]
struct Node {
next: Vec<Link>,
pub offset: u64,
pub command: String,
}
These nodes form the basis of this—improved—transaction log. As...