pub fn write(&mut self, buf: &[u8]) -> Result<usize, StableMemoryError> {
        if self.offset + buf.len() > ((self.capacity as usize) << 16) {
            self.grow((buf.len() >> 16) as u32 + 1)?;
        }

        stable_write(self.offset as u32, buf);
        self.offset += buf.len();
        Ok(buf.len())
    }
/// Writes a byte slice to the buffer.
///
/// The only condition where this will
/// error out is if it cannot grow the memory.
Writes a byte slice to the buffer.
The only condition where this will
error out is if it cannot grow the memory.
Writes a byte slice to the buffer . The only condition where this will error out is if it cannot grow the memory .
pub fn write(&mut self, buf: &[u8]) -> Result<usize, StableMemoryError> {
        if self.offset + buf.len() > ((self.capacity as usize) << 16) {
            self.grow((buf.len() >> 16) as u32 + 1)?;
        }
        stable_write(self.offset as u32, buf);
        self.offset += buf.len();
        Ok(buf.len())
    }
pub fn write ( & mut self , buf : & [ u8 ] ) -> Result < usize , StableMemoryError > { if self . offset + buf . len ( ) > ( ( self . capacity as usize ) << 16 ) { self . grow ( ( buf . len ( ) >> 16 ) as u32 + 1 ) ? ; } stable_write ( self . offset as u32 , buf ) ; self . offset += buf . len ( ) ; Ok ( buf . len ( ) ) }
Writes a byte slice to the buffer.
Writes a byte slice to the buffer .
&mut self
buf
&[u8]