Struct nibi::app::config::Config

source ·
pub struct Config { /* private fields */ }

Implementations§

Examples found in repository?
src/app/config.rs (line 118)
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
pub fn create_config_file(config_path: &Path, config: &Config) -> Result<File, IOError> {
	match new_empty_file(config_path) {
		Ok(target_file) => {
			let serialized_config = config.to_ron(None);
			write_string(target_file, serialized_config)
		}
		err => {
			return err;
		}
	}
}

pub fn reset_config_file(config_path: &Path, config: &Config) -> Result<File, IOError> {
	match open_file_with_overwrite_mode(config_path) {
		Ok(target_file) => {
			let serialized_config = config.to_ron(None);
			write_string(target_file, serialized_config)
		}
		err => {
			return err;
		}
	}
}
Examples found in repository?
src/cmd/init.rs (line 154)
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
fn create_src_dirs(config: &Config, root_dir: &Path) -> bool {
	match config.get_dir_conf().create_src_dirs(root_dir) {
		Err(errs) => {
			for e in errs {
				println!(
					"ディレクトリ {} の作成中にエラーが発生しました: {}",
					e.1.display(),
					e.0
				);
			}
			false
		}
		_ => true,
	}
}

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.