Should we use Option or ptr::null to represent a null pointer in Rust?
问题 The standard library's linked-list Node uses the Option type: struct Node<T> { next: Option<NonNull<Node<T>>>, prev: Option<NonNull<Node<T>>>, element: T, } and creates a node with this code: Node { next: None, prev: None, element, } The implementation of LeafNode of BTree , the standard library uses a raw pointer for the parent node: struct LeafNode<K, V> { parent: *const InternalNode<K, V>, parent_idx: MaybeUninit<u16>, len: u16, keys: MaybeUninit<[K; CAPACITY]>, vals: MaybeUninit<[V;