Comprehensive Rust(繁体中文)變體,而 E 則會出現在 Err 變數 中。 use std::fs::File; use std::io::Read; 81 fn main() { let file: Result<File, std::io::Error> = File::open("diary.txt"); match file { Ok(mut file) => { let mut contents = String::new(); String::new(); if let Ok(bytes) = file.read_to_string(&mut contents) { println!("Dear diary: {contents} ({bytes} bytes)"); } else { println!("Could not read file content"); } } Err(err) => { println!("The ("lines in slice: {}", count_lines(slice)); let file = std::fs::File::open(std::env::current_exe()?)?; println!("lines in file: {}", count_lines(file)); Ok(()) } 同樣地,Write 則可讓您將 u8 接收器抽象化: use std::io::{Result0 码力 | 358 页 | 1.41 MB | 10 月前3
julia 1.13.0 DEV. 388 29 Handling Operating System Variation 391CONTENTS vi 30 Environment Variables 392 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1409 71 Downloads 1413 72 File Events 1417 73 Pidfile 1421 73.1 Primary Functions . . . . . . . . . . . . . . . . . . . . . .0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.11.4. 385 29 Handling Operating System Variation 388CONTENTS vi 30 Environment Variables 389 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1355 70 Downloads 1359 71 File Events 1363CONTENTS xi 72 Pidfile 1365 72.1 Primary Functions . . . . . . . . . . . . . . . . .0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentation. 385 29 Handling Operating System Variation 388CONTENTS vi 30 Environment Variables 389 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1355 70 Downloads 1359 71 File Events 1363CONTENTS xi 72 Pidfile 1365 72.1 Primary Functions . . . . . . . . . . . . . . . . .0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notes. 385 29 Handling Operating System Variation 388CONTENTS vi 30 Environment Variables 389 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1355 70 Downloads 1359 71 File Events 1363CONTENTS xi 72 Pidfile 1365 72.1 Primary Functions . . . . . . . . . . . . . . . . .0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.12.0 RC1. 389 29 Handling Operating System Variation 392CONTENTS vi 30 Environment Variables 393 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1407 71 Downloads 1411 72 File Events 1415 73 Pidfile 1419 73.1 Primary Functions . . . . . . . . . . . . . . . . . . . . . .0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4. 388 29 Handling Operating System Variation 391CONTENTS vi 30 Environment Variables 392 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406 71 Downloads 1410 72 File Events 1414 73 Pidfile 1418 73.1 Primary Functions . . . . . . . . . . . . . . . . . . . . . .0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta3. 388 29 Handling Operating System Variation 391CONTENTS vi 30 Environment Variables 392 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406 71 Downloads 1410 72 File Events 1414 73 Pidfile 1418 73.1 Primary Functions . . . . . . . . . . . . . . . . . . . . . .0 码力 | 2057 页 | 7.44 MB | 3 月前3
julia 1.12.0 beta1. 388 29 Handling Operating System Variation 391CONTENTS vi 30 Environment Variables 392 30.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 30.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.4 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 41.5 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1398 70 Downloads 1402 71 File Events 1406 72 Pidfile 1410 72.1 Primary Functions . . . . . . . . . . . . . . . . . . . . . .0 码力 | 2047 页 | 7.41 MB | 3 月前3
julia 1.10.10. . . . . . . 363 28 Handling Operating System Variation 366 29 Environment Variables 367 29.1 File locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 29.2 Pkg mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 40.3 Startup file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494 40.4 Command-line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1160 68 Downloads 1164 69 File Events 1168 70 Pidfile 1170 70.1 Primary Functions . . . . . . . . . . . . . . . . . . . . . .0 码力 | 1692 页 | 6.34 MB | 3 月前3
共 39 条
- 1
- 2
- 3
- 4













