検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 13 for file (0.025 sec.)
open - Rust By Example 日本語版 12017
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... で読み込み専用モードでファイルを開くことが可能です。 File はファイルディスクリプタという資源を保持しており、 ... を見てくれます。 use std::error::Error; use std::fs::File; use std::io::prelude::*; use std::path::Path; fn ... main() { // Create a path to the desired file // 目的ファイルに対する`Path`を作成 let path = Pat ... en the path in read-only mode, returns `io::Result<File>` // pathを読み込み専用モードで開く。これは`io::Re ...
https://man.plustar.jp/rust/example/std_misc/file/open.html - [similar]
Tests - Rust By Example 日本語版 11331
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ようになります。 $ cargo test Compiling blah v0.1.0 (file:///nobackup/blah) Finished dev [unoptimized + debu ... t_foo $ cargo test test_foo Compiling blah v0.1.0 (file:///nobackup/blah) Finished dev [unoptimized + debu ... urrency causing issues is if two tests output to a file, such as below: #![allow(unused)] fn main() { #[cf ... ions; use std::io::Write; // This test writes to a file #[test] fn test_file() { // Opens the file ferris. ...
https://man.plustar.jp/rust/example/cargo/test.html - [similar]
create - Rust By Example 日本語版 11331
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... st laborum. "; use std::error::Error; use std::fs::File; use std::io::prelude::*; use std::path::Path; fn ... sum.txt"); let display = path.display(); // Open a file in write-only mode, returns `io::Result<File>` // ... イルを書き込み専用モードで開く。返り値は`io::Result<File>` let mut file = match File::create(&path) { Err(w ... panic!("couldn't create {}: {}", display, why), Ok(file) => file, }; // Write the `LOREM_IPSUM` string to ...
https://man.plustar.jp/rust/example/std_misc/file/create.html - [similar]
read lines - Rust By Example 日本語版 10451
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... od lines() returns an iterator over the lines of a file. File::open expects a generic, AsRef<Path> . That' ... s what read_lines() expects as input. use std::fs::File; use std::io::{self, BufRead}; use std::path::Path ... ; fn main() { // File hosts must exist in current path before this produ ... urns an Iterator to the Reader of the lines of the file. fn read_lines<P>(filename: P) -> io::Result<io::L ...
https://man.plustar.jp/rust/example/std_misc/file/read_lines.html - [similar]
ファイルシステムとのやり取り - Rust By Example 日本語版 8692
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... をいくつか持っています。 use std::fs; use std::fs::{File, OpenOptions}; use std::io; use std::io::prelude:: ... t(path: &Path) -> io::Result<String> { let mut f = File::open(path)?; let mut s = String::new(); match f.r ... &str, path: &Path) -> io::Result<()> { let mut f = File::create(path)?; f.write_all(s.as_bytes()) } // A s ... implementation of `% touch path` (ignores existing files) // `% touch path`の簡単な実装(すでにファイルが存 ...
https://man.plustar.jp/rust/example/std_misc/fs.html - [similar]
Integration testing - Rust By Example 日本語版 8639
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... integration tests in tests directory next to src . File src/lib.rs : // Define this in a crate called `add ... test. pub fn add(a: i32, b: i32) -> i32 { a + b } File with test: tests/integration_test.rs : // extern c ... nored; 0 measured; 0 filtered out Each Rust source file in the tests directory is compiled as a separate c ... ic functions, importing and using it within tests. File tests/common.rs : pub fn setup() { // some setup c ...
https://man.plustar.jp/rust/example/testing/integration_testing.html - [similar]
クレート - Rust By Example 日本語版 7953
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ートはRustにおけるコンパイルの単位です。 rustc some_file.rs が呼ばれると、 some_file.rs は必ず クレートファ ... イル として扱われます。もし some_file.rs が mod 宣言を含んでいるのならば、コンパイルの 前 ...
https://man.plustar.jp/rust/example/crates.html - [similar]
Dev-dependencies - Rust By Example 日本語版 7618
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... sing a crate that extends standard assert! macros. File Cargo.toml : # standard crate data is left out [de ... v-dependencies] pretty_assertions = "1" File src/lib.rs : // externing crate for test-only use ...
https://man.plustar.jp/rust/example/testing/dev_dependencies.html - [similar]
ファイル I/O - Rust By Example 日本語版 7284
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... oal Navy Ayu Rust By Example 日本語版 ファイル I/O File 構造体は開かれたファイルを表し(実際にはファイルデ ...
https://man.plustar.jp/rust/example/std_misc/file.html - [similar]
メモリ解放 - Rust By Example 日本語版 7284
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... を実装している型の例としては Box 、 Vec 、 String 、 File 、 Process 等があげられます。 Drop トレイトは任意の ...
https://man.plustar.jp/rust/example/trait/drop.html - [similar]
PREV 1 2 NEXT