/// Create a new `DynamicBuffer` of the given size. This method will
/// return an error if the requested number of bytes could not be
/// allocated.
Create a new `DynamicBuffer` of the given size. This method will
return an error if the requested number of bytes could not be
allocated.
Create a new ` DynamicBuffer ` of the given size . This method will return an error if the requested number of bytes could not be allocated .
pub fn new(size: usize) -> Result<Self, &'static str> {
        if size > 0 {
            Ok(DynamicBuffer{ptr: alloc(size), size: size})
        } else {
            Err("Buffer size must be greater than 0")
        }
    }
pub fn new ( size : usize ) -> Result < Self , & ' static str > { if size > 0 { Ok ( DynamicBuffer { ptr : alloc ( size ) , size : size } ) } else { Err ( " " ) } }
Create a new `DynamicBuffer` of the given size.
Create a new ` DynamicBuffer ` of the given size .
size
usize