pub struct HistoryTree<E, Cmd = ()> { /* private fields */ }Expand description
A history tree for non-linear undo-redo action.
Implementations§
Source§impl<Cmd: Default, E: Default> HistoryTree<E, Cmd>
impl<Cmd: Default, E: Default> HistoryTree<E, Cmd>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new history tree.
Examples found in repository?
8fn main() {
9 let mut history_tree: HistoryTree<VecDelta<&str>> = HistoryTree::new();
10 let mut state = Recorder::new(vec!["root"]);
11
12 // Right below the root we push a "fork" node, from which we will fork two
13 // branches.
14 state.push("fork");
15 history_tree.commit(&mut state);
16
17 let fork = history_tree.curr_node();
18
19 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
20
21 // Add first node of left branch.
22 state.push("left_branch_1");
23 history_tree.commit(&mut state);
24
25 let left_branch_1 = history_tree.curr_node();
26
27 // Add second node of left branch.
28 state.push("left_branch_2");
29 history_tree.commit(&mut state);
30
31 let left_branch_2 = history_tree.curr_node();
32
33 // Now we have assembled the whole of the left branch.
34 assert_eq!(
35 *state.as_ref(),
36 vec!["root", "fork", "left_branch_1", "left_branch_2"]
37 );
38
39 // Let's now undo the whole left branch up to the fork node.
40 history_tree.undo(&mut state);
41 history_tree.undo(&mut state);
42
43 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
44 assert_eq!(history_tree.curr_node(), fork);
45
46 // Add first node of right branch.
47 state.push("right_branch_1");
48 history_tree.commit(&mut state);
49
50 let right_branch_1 = history_tree.curr_node();
51
52 // Add second node of right branch.
53 state.push("right_branch_2");
54 history_tree.commit(&mut state);
55
56 let right_branch_2 = history_tree.curr_node();
57
58 // Now we have assembled the whole of the right branch.
59 assert_eq!(
60 *state.as_ref(),
61 vec!["root", "fork", "right_branch_1", "right_branch_2"]
62 );
63
64 let root_children = history_tree
65 .node(history_tree.node(fork).parent().unwrap())
66 .children();
67 assert_eq!(root_children, &[fork]);
68
69 assert_eq!(
70 history_tree.node(fork).children(),
71 &[left_branch_1, right_branch_1]
72 );
73 assert_eq!(
74 history_tree.node(left_branch_1).children(),
75 &[left_branch_2]
76 );
77 assert_eq!(
78 history_tree.node(right_branch_1).children(),
79 &[right_branch_2]
80 );
81
82 // Check out left branch from the apex of the right branch.
83 history_tree.checkout(&mut state, left_branch_2);
84
85 assert_eq!(history_tree.curr_node(), left_branch_2);
86 assert_eq!(
87 *state.as_ref(),
88 vec!["root", "fork", "left_branch_1", "left_branch_2"]
89 );
90
91 // Check out the right branch from the apex of the left branch.
92 history_tree.checkout(&mut state, right_branch_2);
93
94 assert_eq!(history_tree.curr_node(), right_branch_2);
95 assert_eq!(
96 *state.as_ref(),
97 vec!["root", "fork", "right_branch_1", "right_branch_2"]
98 );
99
100 // Let's now undo the whole right branch up to the fork node.
101 history_tree.undo(&mut state);
102 history_tree.undo(&mut state);
103
104 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
105 assert_eq!(history_tree.curr_node(), fork);
106}Source§impl<Cmd, E> HistoryTree<E, Cmd>
impl<Cmd, E> HistoryTree<E, Cmd>
Sourcepub fn curr_node(&self) -> HistoryTreeNodeId
pub fn curr_node(&self) -> HistoryTreeNodeId
Returns the id of the current node.
Examples found in repository?
8fn main() {
9 let mut history_tree: HistoryTree<VecDelta<&str>> = HistoryTree::new();
10 let mut state = Recorder::new(vec!["root"]);
11
12 // Right below the root we push a "fork" node, from which we will fork two
13 // branches.
14 state.push("fork");
15 history_tree.commit(&mut state);
16
17 let fork = history_tree.curr_node();
18
19 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
20
21 // Add first node of left branch.
22 state.push("left_branch_1");
23 history_tree.commit(&mut state);
24
25 let left_branch_1 = history_tree.curr_node();
26
27 // Add second node of left branch.
28 state.push("left_branch_2");
29 history_tree.commit(&mut state);
30
31 let left_branch_2 = history_tree.curr_node();
32
33 // Now we have assembled the whole of the left branch.
34 assert_eq!(
35 *state.as_ref(),
36 vec!["root", "fork", "left_branch_1", "left_branch_2"]
37 );
38
39 // Let's now undo the whole left branch up to the fork node.
40 history_tree.undo(&mut state);
41 history_tree.undo(&mut state);
42
43 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
44 assert_eq!(history_tree.curr_node(), fork);
45
46 // Add first node of right branch.
47 state.push("right_branch_1");
48 history_tree.commit(&mut state);
49
50 let right_branch_1 = history_tree.curr_node();
51
52 // Add second node of right branch.
53 state.push("right_branch_2");
54 history_tree.commit(&mut state);
55
56 let right_branch_2 = history_tree.curr_node();
57
58 // Now we have assembled the whole of the right branch.
59 assert_eq!(
60 *state.as_ref(),
61 vec!["root", "fork", "right_branch_1", "right_branch_2"]
62 );
63
64 let root_children = history_tree
65 .node(history_tree.node(fork).parent().unwrap())
66 .children();
67 assert_eq!(root_children, &[fork]);
68
69 assert_eq!(
70 history_tree.node(fork).children(),
71 &[left_branch_1, right_branch_1]
72 );
73 assert_eq!(
74 history_tree.node(left_branch_1).children(),
75 &[left_branch_2]
76 );
77 assert_eq!(
78 history_tree.node(right_branch_1).children(),
79 &[right_branch_2]
80 );
81
82 // Check out left branch from the apex of the right branch.
83 history_tree.checkout(&mut state, left_branch_2);
84
85 assert_eq!(history_tree.curr_node(), left_branch_2);
86 assert_eq!(
87 *state.as_ref(),
88 vec!["root", "fork", "left_branch_1", "left_branch_2"]
89 );
90
91 // Check out the right branch from the apex of the left branch.
92 history_tree.checkout(&mut state, right_branch_2);
93
94 assert_eq!(history_tree.curr_node(), right_branch_2);
95 assert_eq!(
96 *state.as_ref(),
97 vec!["root", "fork", "right_branch_1", "right_branch_2"]
98 );
99
100 // Let's now undo the whole right branch up to the fork node.
101 history_tree.undo(&mut state);
102 history_tree.undo(&mut state);
103
104 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
105 assert_eq!(history_tree.curr_node(), fork);
106}Sourcepub fn node(&self, id: HistoryTreeNodeId) -> &HistoryTreeNode<E, Cmd>
pub fn node(&self, id: HistoryTreeNodeId) -> &HistoryTreeNode<E, Cmd>
Returns an immutable reference to the node with the given id.
Examples found in repository?
8fn main() {
9 let mut history_tree: HistoryTree<VecDelta<&str>> = HistoryTree::new();
10 let mut state = Recorder::new(vec!["root"]);
11
12 // Right below the root we push a "fork" node, from which we will fork two
13 // branches.
14 state.push("fork");
15 history_tree.commit(&mut state);
16
17 let fork = history_tree.curr_node();
18
19 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
20
21 // Add first node of left branch.
22 state.push("left_branch_1");
23 history_tree.commit(&mut state);
24
25 let left_branch_1 = history_tree.curr_node();
26
27 // Add second node of left branch.
28 state.push("left_branch_2");
29 history_tree.commit(&mut state);
30
31 let left_branch_2 = history_tree.curr_node();
32
33 // Now we have assembled the whole of the left branch.
34 assert_eq!(
35 *state.as_ref(),
36 vec!["root", "fork", "left_branch_1", "left_branch_2"]
37 );
38
39 // Let's now undo the whole left branch up to the fork node.
40 history_tree.undo(&mut state);
41 history_tree.undo(&mut state);
42
43 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
44 assert_eq!(history_tree.curr_node(), fork);
45
46 // Add first node of right branch.
47 state.push("right_branch_1");
48 history_tree.commit(&mut state);
49
50 let right_branch_1 = history_tree.curr_node();
51
52 // Add second node of right branch.
53 state.push("right_branch_2");
54 history_tree.commit(&mut state);
55
56 let right_branch_2 = history_tree.curr_node();
57
58 // Now we have assembled the whole of the right branch.
59 assert_eq!(
60 *state.as_ref(),
61 vec!["root", "fork", "right_branch_1", "right_branch_2"]
62 );
63
64 let root_children = history_tree
65 .node(history_tree.node(fork).parent().unwrap())
66 .children();
67 assert_eq!(root_children, &[fork]);
68
69 assert_eq!(
70 history_tree.node(fork).children(),
71 &[left_branch_1, right_branch_1]
72 );
73 assert_eq!(
74 history_tree.node(left_branch_1).children(),
75 &[left_branch_2]
76 );
77 assert_eq!(
78 history_tree.node(right_branch_1).children(),
79 &[right_branch_2]
80 );
81
82 // Check out left branch from the apex of the right branch.
83 history_tree.checkout(&mut state, left_branch_2);
84
85 assert_eq!(history_tree.curr_node(), left_branch_2);
86 assert_eq!(
87 *state.as_ref(),
88 vec!["root", "fork", "left_branch_1", "left_branch_2"]
89 );
90
91 // Check out the right branch from the apex of the left branch.
92 history_tree.checkout(&mut state, right_branch_2);
93
94 assert_eq!(history_tree.curr_node(), right_branch_2);
95 assert_eq!(
96 *state.as_ref(),
97 vec!["root", "fork", "right_branch_1", "right_branch_2"]
98 );
99
100 // Let's now undo the whole right branch up to the fork node.
101 history_tree.undo(&mut state);
102 history_tree.undo(&mut state);
103
104 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
105 assert_eq!(history_tree.curr_node(), fork);
106}Sourcepub fn parent(&self, id: HistoryTreeNodeId) -> Option<HistoryTreeNodeId>
pub fn parent(&self, id: HistoryTreeNodeId) -> Option<HistoryTreeNodeId>
Returns parent node id of the node with the given id. None for the root.
Sourcepub fn cmd(&self, id: HistoryTreeNodeId) -> &Cmd
pub fn cmd(&self, id: HistoryTreeNodeId) -> &Cmd
Returns an immutable reference to the command metadata at the given node.
Sourcepub fn cmd_mut(&mut self, id: HistoryTreeNodeId) -> &mut Cmd
pub fn cmd_mut(&mut self, id: HistoryTreeNodeId) -> &mut Cmd
Returns a mutable reference to the command metadata at the given node.
Source§impl<Cmd: Default, E> HistoryTree<E, Cmd>
impl<Cmd: Default, E> HistoryTree<E, Cmd>
Sourcepub fn commit<T>(&mut self, target: &mut T)where
E: ExtractEdit<T>,
pub fn commit<T>(&mut self, target: &mut T)where
E: ExtractEdit<T>,
Flush the target container and insert its changes as an edit into a new tree leaf under the current node.
Examples found in repository?
8fn main() {
9 let mut history_tree: HistoryTree<VecDelta<&str>> = HistoryTree::new();
10 let mut state = Recorder::new(vec!["root"]);
11
12 // Right below the root we push a "fork" node, from which we will fork two
13 // branches.
14 state.push("fork");
15 history_tree.commit(&mut state);
16
17 let fork = history_tree.curr_node();
18
19 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
20
21 // Add first node of left branch.
22 state.push("left_branch_1");
23 history_tree.commit(&mut state);
24
25 let left_branch_1 = history_tree.curr_node();
26
27 // Add second node of left branch.
28 state.push("left_branch_2");
29 history_tree.commit(&mut state);
30
31 let left_branch_2 = history_tree.curr_node();
32
33 // Now we have assembled the whole of the left branch.
34 assert_eq!(
35 *state.as_ref(),
36 vec!["root", "fork", "left_branch_1", "left_branch_2"]
37 );
38
39 // Let's now undo the whole left branch up to the fork node.
40 history_tree.undo(&mut state);
41 history_tree.undo(&mut state);
42
43 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
44 assert_eq!(history_tree.curr_node(), fork);
45
46 // Add first node of right branch.
47 state.push("right_branch_1");
48 history_tree.commit(&mut state);
49
50 let right_branch_1 = history_tree.curr_node();
51
52 // Add second node of right branch.
53 state.push("right_branch_2");
54 history_tree.commit(&mut state);
55
56 let right_branch_2 = history_tree.curr_node();
57
58 // Now we have assembled the whole of the right branch.
59 assert_eq!(
60 *state.as_ref(),
61 vec!["root", "fork", "right_branch_1", "right_branch_2"]
62 );
63
64 let root_children = history_tree
65 .node(history_tree.node(fork).parent().unwrap())
66 .children();
67 assert_eq!(root_children, &[fork]);
68
69 assert_eq!(
70 history_tree.node(fork).children(),
71 &[left_branch_1, right_branch_1]
72 );
73 assert_eq!(
74 history_tree.node(left_branch_1).children(),
75 &[left_branch_2]
76 );
77 assert_eq!(
78 history_tree.node(right_branch_1).children(),
79 &[right_branch_2]
80 );
81
82 // Check out left branch from the apex of the right branch.
83 history_tree.checkout(&mut state, left_branch_2);
84
85 assert_eq!(history_tree.curr_node(), left_branch_2);
86 assert_eq!(
87 *state.as_ref(),
88 vec!["root", "fork", "left_branch_1", "left_branch_2"]
89 );
90
91 // Check out the right branch from the apex of the left branch.
92 history_tree.checkout(&mut state, right_branch_2);
93
94 assert_eq!(history_tree.curr_node(), right_branch_2);
95 assert_eq!(
96 *state.as_ref(),
97 vec!["root", "fork", "right_branch_1", "right_branch_2"]
98 );
99
100 // Let's now undo the whole right branch up to the fork node.
101 history_tree.undo(&mut state);
102 history_tree.undo(&mut state);
103
104 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
105 assert_eq!(history_tree.curr_node(), fork);
106}Source§impl<Cmd, E> HistoryTree<E, Cmd>
impl<Cmd, E> HistoryTree<E, Cmd>
Sourcepub fn cmd_commit<T>(&mut self, cmd: Cmd, target: &mut T)where
E: ExtractEdit<T>,
pub fn cmd_commit<T>(&mut self, cmd: Cmd, target: &mut T)where
E: ExtractEdit<T>,
Flush the target container and insert its changes into a new tree leaf under the current node as an edit along with additional metadata (“cmd”).
Source§impl<Cmd: Clone, E: Clone> HistoryTree<E, Cmd>
impl<Cmd: Clone, E: Clone> HistoryTree<E, Cmd>
Sourcepub fn undo<T>(&mut self, target: &mut T) -> Option<Cmd>where
E: RevertEdit<T>,
pub fn undo<T>(&mut self, target: &mut T) -> Option<Cmd>where
E: RevertEdit<T>,
Undo the edit at the current tree node, moving one step upwards to the node’s parent.
This does not cause any changes to the tree topology, only the target container and current node are modified.
Examples found in repository?
8fn main() {
9 let mut history_tree: HistoryTree<VecDelta<&str>> = HistoryTree::new();
10 let mut state = Recorder::new(vec!["root"]);
11
12 // Right below the root we push a "fork" node, from which we will fork two
13 // branches.
14 state.push("fork");
15 history_tree.commit(&mut state);
16
17 let fork = history_tree.curr_node();
18
19 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
20
21 // Add first node of left branch.
22 state.push("left_branch_1");
23 history_tree.commit(&mut state);
24
25 let left_branch_1 = history_tree.curr_node();
26
27 // Add second node of left branch.
28 state.push("left_branch_2");
29 history_tree.commit(&mut state);
30
31 let left_branch_2 = history_tree.curr_node();
32
33 // Now we have assembled the whole of the left branch.
34 assert_eq!(
35 *state.as_ref(),
36 vec!["root", "fork", "left_branch_1", "left_branch_2"]
37 );
38
39 // Let's now undo the whole left branch up to the fork node.
40 history_tree.undo(&mut state);
41 history_tree.undo(&mut state);
42
43 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
44 assert_eq!(history_tree.curr_node(), fork);
45
46 // Add first node of right branch.
47 state.push("right_branch_1");
48 history_tree.commit(&mut state);
49
50 let right_branch_1 = history_tree.curr_node();
51
52 // Add second node of right branch.
53 state.push("right_branch_2");
54 history_tree.commit(&mut state);
55
56 let right_branch_2 = history_tree.curr_node();
57
58 // Now we have assembled the whole of the right branch.
59 assert_eq!(
60 *state.as_ref(),
61 vec!["root", "fork", "right_branch_1", "right_branch_2"]
62 );
63
64 let root_children = history_tree
65 .node(history_tree.node(fork).parent().unwrap())
66 .children();
67 assert_eq!(root_children, &[fork]);
68
69 assert_eq!(
70 history_tree.node(fork).children(),
71 &[left_branch_1, right_branch_1]
72 );
73 assert_eq!(
74 history_tree.node(left_branch_1).children(),
75 &[left_branch_2]
76 );
77 assert_eq!(
78 history_tree.node(right_branch_1).children(),
79 &[right_branch_2]
80 );
81
82 // Check out left branch from the apex of the right branch.
83 history_tree.checkout(&mut state, left_branch_2);
84
85 assert_eq!(history_tree.curr_node(), left_branch_2);
86 assert_eq!(
87 *state.as_ref(),
88 vec!["root", "fork", "left_branch_1", "left_branch_2"]
89 );
90
91 // Check out the right branch from the apex of the left branch.
92 history_tree.checkout(&mut state, right_branch_2);
93
94 assert_eq!(history_tree.curr_node(), right_branch_2);
95 assert_eq!(
96 *state.as_ref(),
97 vec!["root", "fork", "right_branch_1", "right_branch_2"]
98 );
99
100 // Let's now undo the whole right branch up to the fork node.
101 history_tree.undo(&mut state);
102 history_tree.undo(&mut state);
103
104 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
105 assert_eq!(history_tree.curr_node(), fork);
106}Sourcepub fn redo<T>(&mut self, target: &mut T, node: HistoryTreeNodeId) -> Cmdwhere
E: ApplyEdit<T> + RevertEdit<T>,
pub fn redo<T>(&mut self, target: &mut T, node: HistoryTreeNodeId) -> Cmdwhere
E: ApplyEdit<T> + RevertEdit<T>,
Redo the edit at the specified node, moving one step downwards.
This does not cause any changes to the tree topology, only the target container and current node are modified.
Sourcepub fn checkout<T>(
&mut self,
target: &mut T,
target_node: HistoryTreeNodeId,
) -> Vec<Cmd>where
E: ApplyEdit<T> + RevertEdit<T>,
pub fn checkout<T>(
&mut self,
target: &mut T,
target_node: HistoryTreeNodeId,
) -> Vec<Cmd>where
E: ApplyEdit<T> + RevertEdit<T>,
Move from the current node to the target node.
First, a sequence of calls to Self::undo is made to climb to the
lowest common ancestor, and then a sequence of calls to Self::redo
is performed to descend to the target node.
Returns the list of command metadata produced by the redo phase in the
order they were applied. If already at target_node, an empty vector is
returned.
Examples found in repository?
8fn main() {
9 let mut history_tree: HistoryTree<VecDelta<&str>> = HistoryTree::new();
10 let mut state = Recorder::new(vec!["root"]);
11
12 // Right below the root we push a "fork" node, from which we will fork two
13 // branches.
14 state.push("fork");
15 history_tree.commit(&mut state);
16
17 let fork = history_tree.curr_node();
18
19 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
20
21 // Add first node of left branch.
22 state.push("left_branch_1");
23 history_tree.commit(&mut state);
24
25 let left_branch_1 = history_tree.curr_node();
26
27 // Add second node of left branch.
28 state.push("left_branch_2");
29 history_tree.commit(&mut state);
30
31 let left_branch_2 = history_tree.curr_node();
32
33 // Now we have assembled the whole of the left branch.
34 assert_eq!(
35 *state.as_ref(),
36 vec!["root", "fork", "left_branch_1", "left_branch_2"]
37 );
38
39 // Let's now undo the whole left branch up to the fork node.
40 history_tree.undo(&mut state);
41 history_tree.undo(&mut state);
42
43 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
44 assert_eq!(history_tree.curr_node(), fork);
45
46 // Add first node of right branch.
47 state.push("right_branch_1");
48 history_tree.commit(&mut state);
49
50 let right_branch_1 = history_tree.curr_node();
51
52 // Add second node of right branch.
53 state.push("right_branch_2");
54 history_tree.commit(&mut state);
55
56 let right_branch_2 = history_tree.curr_node();
57
58 // Now we have assembled the whole of the right branch.
59 assert_eq!(
60 *state.as_ref(),
61 vec!["root", "fork", "right_branch_1", "right_branch_2"]
62 );
63
64 let root_children = history_tree
65 .node(history_tree.node(fork).parent().unwrap())
66 .children();
67 assert_eq!(root_children, &[fork]);
68
69 assert_eq!(
70 history_tree.node(fork).children(),
71 &[left_branch_1, right_branch_1]
72 );
73 assert_eq!(
74 history_tree.node(left_branch_1).children(),
75 &[left_branch_2]
76 );
77 assert_eq!(
78 history_tree.node(right_branch_1).children(),
79 &[right_branch_2]
80 );
81
82 // Check out left branch from the apex of the right branch.
83 history_tree.checkout(&mut state, left_branch_2);
84
85 assert_eq!(history_tree.curr_node(), left_branch_2);
86 assert_eq!(
87 *state.as_ref(),
88 vec!["root", "fork", "left_branch_1", "left_branch_2"]
89 );
90
91 // Check out the right branch from the apex of the left branch.
92 history_tree.checkout(&mut state, right_branch_2);
93
94 assert_eq!(history_tree.curr_node(), right_branch_2);
95 assert_eq!(
96 *state.as_ref(),
97 vec!["root", "fork", "right_branch_1", "right_branch_2"]
98 );
99
100 // Let's now undo the whole right branch up to the fork node.
101 history_tree.undo(&mut state);
102 history_tree.undo(&mut state);
103
104 assert_eq!(*state.as_ref(), vec!["root", "fork"]);
105 assert_eq!(history_tree.curr_node(), fork);
106}Trait Implementations§
Source§impl<E: Clone, Cmd: Clone> Clone for HistoryTree<E, Cmd>
impl<E: Clone, Cmd: Clone> Clone for HistoryTree<E, Cmd>
Source§fn clone(&self) -> HistoryTree<E, Cmd>
fn clone(&self) -> HistoryTree<E, Cmd>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<E: Eq, Cmd: Eq> Eq for HistoryTree<E, Cmd>
impl<E: PartialEq, Cmd: PartialEq> StructuralPartialEq for HistoryTree<E, Cmd>
Auto Trait Implementations§
impl<E, Cmd> Freeze for HistoryTree<E, Cmd>
impl<E, Cmd> RefUnwindSafe for HistoryTree<E, Cmd>
impl<E, Cmd> Send for HistoryTree<E, Cmd>
impl<E, Cmd> Sync for HistoryTree<E, Cmd>
impl<E, Cmd> Unpin for HistoryTree<E, Cmd>
impl<E, Cmd> UnsafeUnpin for HistoryTree<E, Cmd>
impl<E, Cmd> UnwindSafe for HistoryTree<E, Cmd>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.