Lines Matching defs:ByteSlice

33 /// `ByteSlice` abstracts over the mutability of a byte slice reference, and is
39 /// Implementations of `ByteSlice` must promise that their implementations of
40 /// [`Deref`] and [`DerefMut`] are "stable". In particular, given `B: ByteSlice`
44 /// `ByteSlice`, [`ByteSliceMut`], [`IntoByteSlice`], or [`IntoByteSliceMut`],
52 pub unsafe trait ByteSlice: Deref<Target = [u8]> + Sized {}
60 /// `ByteSliceMut` is a shorthand for [`ByteSlice`] and [`DerefMut`].
61 pub trait ByteSliceMut: ByteSlice + DerefMut {}
62 impl<B: ByteSlice + DerefMut> ByteSliceMut for B {}
64 /// A [`ByteSlice`] which can be copied without violating dereference stability.
69 /// required by [`ByteSlice`] (see that trait's safety documentation) do not
73 pub unsafe trait CopyableByteSlice: ByteSlice + Copy + CloneableByteSlice {}
75 /// A [`ByteSlice`] which can be cloned without violating dereference stability.
80 /// required by [`ByteSlice`] (see that trait's safety documentation) do not
84 pub unsafe trait CloneableByteSlice: ByteSlice + Clone {}
86 /// A [`ByteSlice`] that can be split in two.
101 pub unsafe trait SplitByteSlice: ByteSlice {
115 // invariant on `ByteSlice`, a supertrait of `SplitByteSlice`,
149 /// A [`ByteSlice`] that conveys no ownership, and so can be converted into a
152 /// Some `ByteSlice` types (notably, the standard library's [`Ref`] type) convey
155 /// are only compatible with `ByteSlice` types without these ownership
159 pub unsafe trait IntoByteSlice<'a>: ByteSlice {
167 /// Note that, combined with the safety invariant on [`ByteSlice`], this
169 /// sense described in the `ByteSlice` docs.
192 /// Note that, combined with the safety invariant on [`ByteSlice`], this
194 /// sense described in the `ByteSlice` docs.
200 unsafe impl ByteSlice for &[u8] {}
238 unsafe impl ByteSlice for &mut [u8] {}
326 unsafe impl ByteSlice for cell::Ref<'_, [u8]> {}
346 unsafe impl ByteSlice for cell::RefMut<'_, [u8]> {}