|
63 | 63 | self.into_mut()
|
64 | 64 | }
|
65 | 65 | }
|
| 66 | + |
| 67 | +impl<B, T> Ref<B, [T]> |
| 68 | +where |
| 69 | + B: SplitByteSlice, |
| 70 | + T: Immutable, |
| 71 | +{ |
| 72 | + #[deprecated(since = "0.8.0", note = "replaced by `Ref::with_trailing_elements_from_prefix`")] |
| 73 | + #[must_use = "has no side effects"] |
| 74 | + #[doc(hidden)] |
| 75 | + #[inline] |
| 76 | + pub fn new_slice_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> { |
| 77 | + Ref::with_trailing_elements_from_prefix(bytes, count) |
| 78 | + } |
| 79 | + |
| 80 | + #[deprecated(since = "0.8.0", note = "replaced by `Ref::with_trailing_elements_from_suffix`")] |
| 81 | + #[must_use = "has no side effects"] |
| 82 | + #[doc(hidden)] |
| 83 | + #[inline] |
| 84 | + pub fn new_slice_from_suffix(bytes: B, count: usize) -> Option<(B, Ref<B, [T]>)> { |
| 85 | + Ref::with_trailing_elements_from_suffix(bytes, count) |
| 86 | + } |
| 87 | +} |
| 88 | + |
| 89 | +impl<B, T> Ref<B, [T]> |
| 90 | +where |
| 91 | + B: SplitByteSlice, |
| 92 | + T: Unaligned + Immutable, |
| 93 | +{ |
| 94 | + #[deprecated( |
| 95 | + since = "0.8.0", |
| 96 | + note = "replaced by `Ref::with_trailing_elements_unaligned_from_prefix`" |
| 97 | + )] |
| 98 | + #[doc(hidden)] |
| 99 | + #[must_use = "has no side effects"] |
| 100 | + #[inline(always)] |
| 101 | + pub fn new_slice_unaligned_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> { |
| 102 | + Ref::with_trailing_elements_unaligned_from_prefix(bytes, count) |
| 103 | + } |
| 104 | + |
| 105 | + #[deprecated( |
| 106 | + since = "0.8.0", |
| 107 | + note = "replaced by `Ref::with_trailing_elements_unaligned_from_suffix`" |
| 108 | + )] |
| 109 | + #[doc(hidden)] |
| 110 | + #[must_use = "has no side effects"] |
| 111 | + #[inline(always)] |
| 112 | + pub fn new_slice_unaligned_from_suffix(bytes: B, count: usize) -> Option<(B, Ref<B, [T]>)> { |
| 113 | + Ref::with_trailing_elements_unaligned_from_suffix(bytes, count) |
| 114 | + } |
| 115 | +} |
0 commit comments