MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / advance

Method advance

crates/tinywasm/src/reference.rs:90–95  ·  view source on GitHub ↗
(&mut self, amount: usize)

Source from the content-addressed store, hash-verified

88 }
89
90 fn advance(&mut self, amount: usize) -> crate::std::io::Result<()> {
91 self.position = self.position.checked_add(amount as u64).ok_or_else(|| {
92 crate::std::io::Error::new(crate::std::io::ErrorKind::InvalidInput, "cursor position overflow")
93 })?;
94 Ok(())
95 }
96
97 /// Returns the current cursor position.
98 pub const fn position(&self) -> u64 {

Callers 2

readMethod · 0.80
writeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected