enum IoErrorKind
Why a file or OS operation failed: NotFound, PermissionDenied, AlreadyExists, InvalidData or Other.
Example:
fn advice(k: IoErrorKind) -> str {
match k {
.NotFound => "create it first"
.PermissionDenied => "check the permissions"
.AlreadyExists => "pick another name"
.InvalidData => "the content is damaged"
.Other => "see the message"
}
}
fn main() io {
print(advice(IoErrorKind.NotFound))
}Вывод
create it first
pub(api) enum IoErrorKindС версии. 1.0.0-beta
Варианты
NotFound | The path does not exist. |
PermissionDenied | The process may not do it. |
AlreadyExists | The path exists already. |
InvalidData | The content is damaged or not valid for the operation. |
Other | Any other failure. |
Определено в: std/core/types.oxl:1442