Skip to content

Commit 18b4bc0

Browse files
authored
Add public accessors of sub-contexts of WasiCtx (#11474)
This is intended to assist with embedders who aren't necessarily using `WasiView` for everything.
1 parent ada802c commit 18b4bc0

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

RELEASES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 36.0.1
2+
3+
Released 2025-08-20.
4+
5+
### Added
6+
7+
* Accessors for internal WASI-related contexts are added to
8+
`wasmtime_wasi::WasiCtx` to account for refactorings that happened in this
9+
release.
10+
[#11473](https://github.com/bytecodealliance/wasmtime/pull/11473)
11+
12+
--------------------------------------------------------------------------------
13+
114
## 36.0.0
215

316
Released 2025-08-20.

crates/wasi/src/ctx.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,4 +533,24 @@ impl WasiCtx {
533533
pub fn builder() -> WasiCtxBuilder {
534534
WasiCtxBuilder::new()
535535
}
536+
537+
/// Returns access to the underlying [`WasiRandomCtx`].
538+
pub fn random(&mut self) -> &mut WasiRandomCtx {
539+
&mut self.random
540+
}
541+
542+
/// Returns access to the underlying [`WasiClocksCtx`].
543+
pub fn clocks(&mut self) -> &mut WasiClocksCtx {
544+
&mut self.clocks
545+
}
546+
547+
/// Returns access to the underlying [`WasiCliCtx`].
548+
pub fn cli(&mut self) -> &mut WasiCliCtx {
549+
&mut self.cli
550+
}
551+
552+
/// Returns access to the underlying [`WasiSocketsCtx`].
553+
pub fn sockets(&mut self) -> &mut WasiSocketsCtx {
554+
&mut self.sockets
555+
}
536556
}

0 commit comments

Comments
 (0)