Lines Matching full:ref
17 impl<B, T> Ref<B, T> impl
22 #[deprecated(since = "0.8.0", note = "renamed to `Ref::from_bytes`")]
26 pub fn new(bytes: B) -> Option<Ref<B, T>> { in new()
31 impl<B, T> Ref<B, T> implementation
36 #[deprecated(since = "0.8.0", note = "renamed to `Ref::from_prefix`")]
40 pub fn new_from_prefix(bytes: B) -> Option<(Ref<B, T>, B)> { in new_from_prefix()
45 impl<B, T> Ref<B, T> implementation
50 #[deprecated(since = "0.8.0", note = "renamed to `Ref::from_suffix`")]
54 pub fn new_from_suffix(bytes: B) -> Option<(B, Ref<B, T>)> { in new_from_suffix()
59 impl<B, T> Ref<B, T> impl
66 …note = "use `Ref::from_bytes`; for `T: Unaligned`, the returned `CastError` implements `Into<SizeE…
71 pub fn new_unaligned(bytes: B) -> Option<Ref<B, T>> { in new_unaligned()
76 impl<B, T> Ref<B, T> implementation
83 …note = "use `Ref::from_prefix`; for `T: Unaligned`, the returned `CastError` implements `Into<Size…
88 pub fn new_unaligned_from_prefix(bytes: B) -> Option<(Ref<B, T>, B)> { in new_unaligned_from_prefix()
93 impl<B, T> Ref<B, T> impl
100 …note = "use `Ref::from_suffix`; for `T: Unaligned`, the returned `CastError` implements `Into<Size…
105 pub fn new_unaligned_from_suffix(bytes: B) -> Option<(B, Ref<B, T>)> { in new_unaligned_from_suffix()
110 impl<B, T> Ref<B, [T]> impl
115 #[deprecated(since = "0.8.0", note = "`Ref::from_bytes` now supports slices")]
118 pub fn new_slice(bytes: B) -> Option<Ref<B, [T]>> { in new_slice()
123 impl<B, T> Ref<B, [T]> impl
130 …note = "`Ref::from_bytes` now supports slices; for `T: Unaligned`, the returned `CastError` implem…
134 pub fn new_slice_unaligned(bytes: B) -> Option<Ref<B, [T]>> { in new_slice_unaligned()
135 Ref::from_bytes(bytes).ok() in new_slice_unaligned()
139 impl<'a, B, T> Ref<B, [T]> impl
144 #[deprecated(since = "0.8.0", note = "`Ref::into_ref` now supports slices")]
148 Ref::into_ref(self) in into_slice()
152 impl<'a, B, T> Ref<B, [T]> implementation
157 #[deprecated(since = "0.8.0", note = "`Ref::into_mut` now supports slices")]
161 Ref::into_mut(self) in into_mut_slice()
165 impl<B, T> Ref<B, [T]> impl
170 #[deprecated(since = "0.8.0", note = "replaced by `Ref::from_prefix_with_elems`")]
174 pub fn new_slice_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> { in new_slice_from_prefix()
175 Ref::from_prefix_with_elems(bytes, count).ok() in new_slice_from_prefix()
178 #[deprecated(since = "0.8.0", note = "replaced by `Ref::from_suffix_with_elems`")]
182 pub fn new_slice_from_suffix(bytes: B, count: usize) -> Option<(B, Ref<B, [T]>)> { in new_slice_from_suffix()
183 Ref::from_suffix_with_elems(bytes, count).ok() in new_slice_from_suffix()
187 impl<B, T> Ref<B, [T]> impl
194 …note = "use `Ref::from_prefix_with_elems`; for `T: Unaligned`, the returned `CastError` implements…
199 pub fn new_slice_unaligned_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> { in new_slice_unaligned_from_prefix()
200 Ref::from_prefix_with_elems(bytes, count).ok() in new_slice_unaligned_from_prefix()
205 …note = "use `Ref::from_suffix_with_elems`; for `T: Unaligned`, the returned `CastError` implements…
210 pub fn new_slice_unaligned_from_suffix(bytes: B, count: usize) -> Option<(B, Ref<B, [T]>)> { in new_slice_unaligned_from_suffix()
211 Ref::from_suffix_with_elems(bytes, count).ok() in new_slice_unaligned_from_suffix()
225 let r: Option<Ref<&[u8], u8>> = Ref::new(bytes); in test_deprecated_ref_methods()
228 let r: Option<(Ref<&[u8], u8>, &[u8])> = Ref::new_from_prefix(bytes); in test_deprecated_ref_methods()
231 let r: Option<(&[u8], Ref<&[u8], u8>)> = Ref::new_from_suffix(bytes); in test_deprecated_ref_methods()
234 let r: Option<Ref<&[u8], u8>> = Ref::new_unaligned(bytes); in test_deprecated_ref_methods()
237 let r: Option<(Ref<&[u8], u8>, &[u8])> = Ref::new_unaligned_from_prefix(bytes); in test_deprecated_ref_methods()
240 let r: Option<(&[u8], Ref<&[u8], u8>)> = Ref::new_unaligned_from_suffix(bytes); in test_deprecated_ref_methods()
243 let r: Option<Ref<&[u8], [u8]>> = Ref::new_slice(bytes_slice); in test_deprecated_ref_methods()
246 let r: Option<Ref<&[u8], [u8]>> = Ref::new_slice_unaligned(bytes_slice); in test_deprecated_ref_methods()
249 let r: Option<(Ref<&[u8], [u8]>, &[u8])> = Ref::new_slice_from_prefix(bytes_slice, 1); in test_deprecated_ref_methods()
252 let r: Option<(&[u8], Ref<&[u8], [u8]>)> = Ref::new_slice_from_suffix(bytes_slice, 1); in test_deprecated_ref_methods()
255 let r: Option<(Ref<&[u8], [u8]>, &[u8])> = in test_deprecated_ref_methods()
256 Ref::new_slice_unaligned_from_prefix(bytes_slice, 1); in test_deprecated_ref_methods()
259 let r: Option<(&[u8], Ref<&[u8], [u8]>)> = in test_deprecated_ref_methods()
260 Ref::new_slice_unaligned_from_suffix(bytes_slice, 1); in test_deprecated_ref_methods()
268 let r: Ref<&[u8], [u8]> = Ref::from_bytes(bytes).unwrap(); in test_deprecated_into_slice()
277 let r: Ref<&mut [u8], [u8]> = Ref::from_bytes(&mut bytes[..]).unwrap(); in test_deprecated_into_mut_slice()