Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/netsuke-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,50 @@ Implementation details:
builder and hands owned network/command configurations to the registration
routines, avoiding needless cloning of the capability handles.

```mermaid
classDiagram
class read_pipe {
+read_pipe<R>(reader: R, spec: PipeSpec): Result<PipeOutcome, CommandFailure>
}
class read_pipe_capture {
+read_pipe_capture<R>(reader: R, limit: PipeLimit): Result<PipeOutcome, CommandFailure>
}
class read_pipe_tempfile {
+read_pipe_tempfile<R>(reader: R, limit: PipeLimit): Result<PipeOutcome, CommandFailure>
}
read_pipe --> read_pipe_capture : calls
read_pipe --> read_pipe_tempfile : calls
class PipeSpec {
+into_limit(): PipeLimit
+mode(): OutputMode
}
class PipeOutcome {
<<enum>>
Bytes(Vec<u8>)
Tempfile(Utf8PathBuf)
}
class CommandFailure {
<<enum>>
Io
StreamPathNotUtf8
}
class PipeLimit {
+record(read: usize): Result<(), CommandFailure>
}
class OutputMode {
<<enum>>
Capture
Tempfile
}
read_pipe ..> PipeSpec : uses
read_pipe_capture ..> PipeLimit : uses
read_pipe_tempfile ..> PipeLimit : uses
read_pipe_capture ..> PipeOutcome : returns
read_pipe_tempfile ..> PipeOutcome : returns
read_pipe_capture ..> CommandFailure : error
read_pipe_tempfile ..> CommandFailure : error
```

Custom external commands can be registered as additional filters. Those should
be marked `pure` if safe for caching or `impure` otherwise.

Expand Down
4 changes: 3 additions & 1 deletion src/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,7 @@ fn stdlib_config_for_manifest(path: &Path, policy: NetworkPolicy) -> Result<Stdl
"failed to open workspace directory '{utf8_parent}' for manifest '{manifest_label}'"
)
})?;
Ok(StdlibConfig::new(dir).with_network_policy(policy))
Ok(StdlibConfig::new(dir)
.with_workspace_root_path(utf8_parent.to_path_buf())
.with_network_policy(policy))
}
Loading
Loading