MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / push_input

Method push_input

src/pglite/postgres_mod.rs:2776–2797  ·  view source on GitHub ↗
(
        &self,
        store: &mut Store,
        env: &WasiFunctionEnv,
        allocator: &GuestAllocator,
        bytes: &[u8],
    )

Source from the content-addressed store, hash-verified

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

Callers 2

send_protocol_innerMethod · 0.80

Calls 2

with_bytesMethod · 0.80
lenMethod · 0.80

Tested by

no test coverage detected