(
&self,
store: &mut Store,
env: &WasiFunctionEnv,
allocator: &GuestAllocator,
bytes: &[u8],
)
| 2774 | } |
| 2775 | |
| 2776 | fn push_input( |
| 2777 | &self, |
| 2778 | store: &mut Store, |
| 2779 | env: &WasiFunctionEnv, |
| 2780 | allocator: &GuestAllocator, |
| 2781 | bytes: &[u8], |
| 2782 | ) -> Result<()> { |
| 2783 | if bytes.is_empty() { |
| 2784 | return Ok(()); |
| 2785 | } |
| 2786 | let written = allocator.with_bytes(store, env, bytes, |store, ptr| { |
| 2787 | self.input_write |
| 2788 | .call(&mut *store, ptr, bytes.len() as i32) |
| 2789 | .context("pgl_wasix_input_write") |
| 2790 | })?; |
| 2791 | ensure!( |
| 2792 | written == bytes.len() as i32, |
| 2793 | "pgl_wasix_input_write wrote {written}, expected {}", |
| 2794 | bytes.len() |
| 2795 | ); |
| 2796 | Ok(()) |
| 2797 | } |
| 2798 | |
| 2799 | fn available(&self, store: &mut Store) -> Result<i32> { |
| 2800 | let available = self |
no test coverage detected