This commit is contained in:
+7
-2
@@ -1,6 +1,7 @@
|
||||
//! On-disk layout of a Sausage world. The folder is the source of truth:
|
||||
//! `sausage run` boots every actor that it finds in `actor/`, and then
|
||||
//! watches the folder (`watch.rs`).
|
||||
//! watches the folder (`watch.rs`). `/self` aliases the running actor's folder;
|
||||
//! `/public` and `/data` remain aliases for its `public/` and `data/`.
|
||||
//!
|
||||
//! ```text
|
||||
//! <world>/ mounted at /, readable and writable by every actor
|
||||
@@ -194,7 +195,8 @@ impl World {
|
||||
/// Map a path in an actor's namespace to a host path.
|
||||
///
|
||||
/// - Absolute paths are relative to the world root.
|
||||
/// - `/public/...` and `/data/...` alias `sender`'s folders.
|
||||
/// - `/self/...` aliases `sender`'s folder; `/public/...` and `/data/...`
|
||||
/// alias its corresponding children.
|
||||
/// - Native senders (the console) can also give absolute host paths.
|
||||
pub fn resolve(&self, sender: &str, path: &str) -> Result<PathBuf> {
|
||||
let under = |base: PathBuf, rest: &str| -> Result<PathBuf> {
|
||||
@@ -214,6 +216,9 @@ impl World {
|
||||
if let Some(rest) = prefixed("/actor") {
|
||||
return under(self.actors_root(), rest);
|
||||
}
|
||||
if let Some(rest) = prefixed("/self") {
|
||||
return under(self.actor_dir(sender), rest);
|
||||
}
|
||||
if let Some(rest) = prefixed("/public") {
|
||||
return under(self.public_dir(sender), rest);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user