Iterate over all nodes, returning the count.
This operation is O(N). Consider tracking the length separately rather than computing it.
pub fn len(list: DoublyLinkedList) usize
pub fn len(list: DoublyLinkedList) usize {
var count: usize = 0;
var it: ?*const Node = list.first;
while (it) |n| : (it = n.next) count += 1;
return count;
}