@@ -828,7 +828,7 @@ where
828
828
self . get_index_of ( key) . is_some ( )
829
829
}
830
830
831
- /// Return a reference to the value stored for `key`, if it is present,
831
+ /// Return a reference to the stored value for `key`, if it is present,
832
832
/// else `None`.
833
833
///
834
834
/// Computes in **O(1)** time (average).
@@ -844,7 +844,7 @@ where
844
844
}
845
845
}
846
846
847
- /// Return references to the key-value pair stored for `key`,
847
+ /// Return references to the stored key-value pair for the lookup `key`,
848
848
/// if it is present, else `None`.
849
849
///
850
850
/// Computes in **O(1)** time (average).
@@ -860,7 +860,10 @@ where
860
860
}
861
861
}
862
862
863
- /// Return item index, key and value
863
+ /// Return the index with references to the stored key-value pair for the
864
+ /// lookup `key`, if it is present, else `None`.
865
+ ///
866
+ /// Computes in **O(1)** time (average).
864
867
pub fn get_full < Q > ( & self , key : & Q ) -> Option < ( usize , & K , & V ) >
865
868
where
866
869
Q : ?Sized + Hash + Equivalent < K > ,
@@ -873,7 +876,7 @@ where
873
876
}
874
877
}
875
878
876
- /// Return item index, if it exists in the map
879
+ /// Return the item index for `key` , if it is present, else `None`.
877
880
///
878
881
/// Computes in **O(1)** time (average).
879
882
pub fn get_index_of < Q > ( & self , key : & Q ) -> Option < usize >
@@ -890,6 +893,10 @@ where
890
893
}
891
894
}
892
895
896
+ /// Return a mutable reference to the stored value for `key`,
897
+ /// if it is present, else `None`.
898
+ ///
899
+ /// Computes in **O(1)** time (average).
893
900
pub fn get_mut < Q > ( & mut self , key : & Q ) -> Option < & mut V >
894
901
where
895
902
Q : ?Sized + Hash + Equivalent < K > ,
@@ -902,8 +909,8 @@ where
902
909
}
903
910
}
904
911
905
- /// Return references to the key-value pair stored for `key`,
906
- /// if it is present, else `None`.
912
+ /// Return a reference and mutable references to the stored key-value pair
913
+ /// for the lookup `key`, if it is present, else `None`.
907
914
///
908
915
/// Computes in **O(1)** time (average).
909
916
pub fn get_key_value_mut < Q > ( & mut self , key : & Q ) -> Option < ( & K , & mut V ) >
@@ -918,6 +925,10 @@ where
918
925
}
919
926
}
920
927
928
+ /// Return the index with a reference and mutable reference to the stored
929
+ /// key-value pair for the lookup `key`, if it is present, else `None`.
930
+ ///
931
+ /// Computes in **O(1)** time (average).
921
932
pub fn get_full_mut < Q > ( & mut self , key : & Q ) -> Option < ( usize , & K , & mut V ) >
922
933
where
923
934
Q : ?Sized + Hash + Equivalent < K > ,
0 commit comments