INNER CODE UNIT · Rust
share_open_projects
jub0t/Concat · src/crates/concat-api/src/lib.rs:220
pub fn share_open_projects(&mut self, open: OpenProjects) {
self.open = open;
}
/// Confines every write to `roots`: from here on a created project, an
/// instantiated template, an export and a preview file must land under
/// one of them, and any other path is `refused`. Reads - a probe, a
/// project opened by path - are not confined. An empty list confines
/// nothing, which is right for the process's own owner at a terminal
/// and wrong for a socket.
pub fn restrict_writes_to(&mut self, roots: Vec<PathBuf>) {
self.roots = roots
.into_iter()
.map(|root| root.canonicalize().unwrap_or(root))
.collect();
}
/// The roots writes are confined to; empty when they are not.