ps_buffer/methods/clone.rs
1use crate::{Buffer, BufferError};
2
3impl Buffer {
4 #[inline]
5 #[allow(clippy::should_implement_trait)]
6 /// # Errors
7 /// - `AllocationError` is returned if allocation fails.
8 /// - `DeallocationError` is returned if deallocation fails.
9 pub fn clone(&self) -> Result<Self, BufferError> {
10 Self::from_slice(&self[..])
11 }
12}