| 887 | /// zeroing out a buffer or initializing a buffer with a specific byte pattern. |
| 888 | #[inline(always)] |
| 889 | pub fn fill<T>(target: &mut T, value: u8) |
| 890 | where |
| 891 | T: AsMut<[u8]> + ?Sized, |
| 892 | { |
| 893 | let target_slice = target.as_mut(); |
| 894 | unsafe { |
| 895 | sz_fill(target_slice.as_ptr() as *const c_void, target_slice.len(), value); |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | /// Copies the contents of `source` into `target`, overwriting the existing contents of `target`. |
| 900 | /// This function is useful for scenarios where you need to replace the contents of a byte slice |