Trait kernel::utilities::copy_slice::CopyOrErr
source · pub trait CopyOrErr {
// Required method
fn copy_from_slice_or_err(&mut self, src: &Self) -> Result<(), ErrorCode>;
}
Expand description
Interface for copying buffers that cannot panic.
Required Methods§
sourcefn copy_from_slice_or_err(&mut self, src: &Self) -> Result<(), ErrorCode>
fn copy_from_slice_or_err(&mut self, src: &Self) -> Result<(), ErrorCode>
Copy a non-overlapping slice from src
to self
.
This is a non-panicking version of slice::copy_from_slice
.
Returns Err(ErrorCode)
if src
and self
are not the same length.
Object Safety§
This trait is not object safe.