Method
hello_string
(
&mut self,
memory: &mut GuestMemory<'_>,
a_string: GuestPtr<str>,
)
Source from the content-addressed store, hash-verified
| 10 | |
| 11 | impl<'a> strings::Strings for WasiCtx<'a> { |
| 12 | fn hello_string( |
| 13 | &mut self, |
| 14 | memory: &mut GuestMemory<'_>, |
| 15 | a_string: GuestPtr<str>, |
| 16 | ) -> Result<u32, types::Errno> { |
| 17 | let s = memory |
| 18 | .as_str(a_string) |
| 19 | .expect("should be valid string") |
| 20 | .expect("expected non-shared memory"); |
| 21 | println!("a_string='{}'", &*s); |
| 22 | Ok(s.len() as u32) |
| 23 | } |
| 24 | |
| 25 | fn multi_string( |
| 26 | &mut self, |
Callers
nothing calls this directly
Tested by
no test coverage detected