@@ -906,7 +906,13 @@ impl Metadata {
906
906
FileType ( self . 0 . file_type ( ) )
907
907
}
908
908
909
- /// Returns whether this metadata is for a directory.
909
+ /// Returns whether this metadata is for a directory. The
910
+ /// result is mutually exclusive to the result of
911
+ /// [`is_file`], and will be false for symlink metadata
912
+ /// obtained from [`symlink_metadata`].
913
+ ///
914
+ /// [`is_file`]: struct.Metadata.html#method.is_file
915
+ /// [`symlink_metadata`]: fn.symlink_metadata.html
910
916
///
911
917
/// # Examples
912
918
///
@@ -923,7 +929,13 @@ impl Metadata {
923
929
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
924
930
pub fn is_dir ( & self ) -> bool { self . file_type ( ) . is_dir ( ) }
925
931
926
- /// Returns whether this metadata is for a regular file.
932
+ /// Returns whether this metadata is for a regular file. The
933
+ /// result is mutually exclusive to the result of
934
+ /// [`is_dir`], and will be false for symlink metadata
935
+ /// obtained from [`symlink_metadata`].
936
+ ///
937
+ /// [`is_dir`]: struct.Metadata.html#method.is_dir
938
+ /// [`symlink_metadata`]: fn.symlink_metadata.html
927
939
///
928
940
/// # Examples
929
941
///
@@ -1148,7 +1160,13 @@ impl Permissions {
1148
1160
}
1149
1161
1150
1162
impl FileType {
1151
- /// Test whether this file type represents a directory.
1163
+ /// Test whether this file type represents a directory. The
1164
+ /// result is mutually exclusive to the results of
1165
+ /// [`is_file`] and [`is_symlink`]; only zero or one of these
1166
+ /// tests may pass.
1167
+ ///
1168
+ /// [`is_file`]: struct.FileType.html#method.is_file
1169
+ /// [`is_symlink`]: struct.FileType.html#method.is_symlink
1152
1170
///
1153
1171
/// # Examples
1154
1172
///
@@ -1167,6 +1185,12 @@ impl FileType {
1167
1185
pub fn is_dir ( & self ) -> bool { self . 0 . is_dir ( ) }
1168
1186
1169
1187
/// Test whether this file type represents a regular file.
1188
+ /// The result is mutually exclusive to the results of
1189
+ /// [`is_dir`] and [`is_symlink`]; only zero or one of these
1190
+ /// tests may pass.
1191
+ ///
1192
+ /// [`is_dir`]: struct.FileType.html#method.is_dir
1193
+ /// [`is_symlink`]: struct.FileType.html#method.is_symlink
1170
1194
///
1171
1195
/// # Examples
1172
1196
///
@@ -1185,6 +1209,9 @@ impl FileType {
1185
1209
pub fn is_file ( & self ) -> bool { self . 0 . is_file ( ) }
1186
1210
1187
1211
/// Test whether this file type represents a symbolic link.
1212
+ /// The result is mutually exclusive to the results of
1213
+ /// [`is_dir`] and [`is_file`]; only zero or one of these
1214
+ /// tests may pass.
1188
1215
///
1189
1216
/// The underlying [`Metadata`] struct needs to be retrieved
1190
1217
/// with the [`fs::symlink_metadata`] function and not the
@@ -1195,6 +1222,8 @@ impl FileType {
1195
1222
/// [`Metadata`]: struct.Metadata.html
1196
1223
/// [`fs::metadata`]: fn.metadata.html
1197
1224
/// [`fs::symlink_metadata`]: fn.symlink_metadata.html
1225
+ /// [`is_dir`]: struct.FileType.html#method.is_dir
1226
+ /// [`is_file`]: struct.FileType.html#method.is_file
1198
1227
/// [`is_symlink`]: struct.FileType.html#method.is_symlink
1199
1228
///
1200
1229
/// # Examples
0 commit comments