pub struct TmcProjectYml {
pub extra_student_files: Vec<PathBuf>,
pub extra_exercise_files: Vec<PathBuf>,
pub force_update: Vec<PathBuf>,
pub tests_timeout_ms: Option<u32>,
pub no_tests: Option<NoTests>,
pub fail_on_valgrind_error: Option<bool>,
pub minimum_python_version: Option<PythonVer>,
pub sandbox_image: Option<String>,
pub submission_size_limit_mb: Option<u32>,
}Expand description
Extra data from a .tmcproject.yml file.
Fields§
§extra_student_files: Vec<PathBuf>A list of files or directories that will always be considered student files.
extra_exercise_files: Vec<PathBuf>A list of files or directories that will always be considered exercise files.
extra_student_files takes precedence if a file is both an extra student file and an extra exercise file.
force_update: Vec<PathBuf>A list of files that should always be overwritten by updates even if they are student files.
tests_timeout_ms: Option<u32>If set, tests are forcibly stopped after this duration.
no_tests: Option<NoTests>Marks the exercise as not containing any tests.
fail_on_valgrind_error: Option<bool>If set, Valgrind errors will be considered test errors.
minimum_python_version: Option<PythonVer>If set, will cause an error telling the student to update their Python if their version is older than the minimum.
sandbox_image: Option<String>Overrides the default sandbox image. e.g. eu.gcr.io/moocfi-public/tmc-sandbox-python:latest
submission_size_limit_mb: Option<u32>Overrides the default archive size limit (500 Mb).
Implementations§
Source§impl TmcProjectYml
impl TmcProjectYml
Sourcepub fn load_or_default(project_dir: &Path) -> Result<Self, TmcError>
pub fn load_or_default(project_dir: &Path) -> Result<Self, TmcError>
Loads a TmcProjectYml either from the directory or the default if there is none.
Sourcepub fn load(project_dir: &Path) -> Result<Option<Self>, TmcError>
pub fn load(project_dir: &Path) -> Result<Option<Self>, TmcError>
Loads a TmcProjectYml from the given directory. Returns None if no such file exists.
Sourcepub fn merge(&mut self, with: Self)
pub fn merge(&mut self, with: Self)
Merges the contents of with with self.
Empty or missing values in self are replaced with those from with. Other values are left unchanged.
Notably it does not merge lists together.
Sourcepub fn save_to_dir(&self, dir: &Path) -> Result<(), TmcError>
pub fn save_to_dir(&self, dir: &Path) -> Result<(), TmcError>
Saves the TmcProjectYml to the given directory.
pub fn get_submission_size_limit_mb(&self) -> u32
Trait Implementations§
Source§impl Clone for TmcProjectYml
impl Clone for TmcProjectYml
Source§fn clone(&self) -> TmcProjectYml
fn clone(&self) -> TmcProjectYml
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more