pub struct OwnedSlice<'a, T: 'a + Sized> { /* private fields */ }
Expand description
Wrap a slice and convert to a Vec on serialize.
We use a hidden inner enum so the public API can be safe,
unless the user uses the unsafe OwnedSlice::from_raw_parts
Implementations
sourceimpl<'a, T> OwnedSlice<'a, T>
impl<'a, T> OwnedSlice<'a, T>
sourcepub unsafe fn from_raw_parts(ptr: *const T, len: usize) -> Self
pub unsafe fn from_raw_parts(ptr: *const T, len: usize) -> Self
Create a new OwnedSlice
from a raw pointer and length
Safety
The pointer must be valid and point to a map of the size size_of<T>() * len
The contents will be dereferenced in subsequent operations.
Trait Implementations
sourceimpl<'a, T: Sized> AsSlice<T> for OwnedSlice<'a, T>
impl<'a, T: Sized> AsSlice<T> for OwnedSlice<'a, T>
sourceimpl<'a, T: 'a + Clone> Clone for OwnedSlice<'a, T>
impl<'a, T: 'a + Clone> Clone for OwnedSlice<'a, T>
sourceimpl<'a, T: Debug + 'a + Sized> Debug for OwnedSlice<'a, T>
impl<'a, T: Debug + 'a + Sized> Debug for OwnedSlice<'a, T>
sourceimpl<'de, 'a, T: 'a + Sized> Deserialize<'de> for OwnedSlice<'a, T> where
T: Deserialize<'de>,
impl<'de, 'a, T: 'a + Sized> Deserialize<'de> for OwnedSlice<'a, T> where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a, T> From<&'a [T]> for OwnedSlice<'a, T>
impl<'a, T> From<&'a [T]> for OwnedSlice<'a, T>
Create a new OwnedSlice
from a reference to a slice
sourceimpl<'a, T> From<&'a Vec<T, Global>> for OwnedSlice<'a, T>
impl<'a, T> From<&'a Vec<T, Global>> for OwnedSlice<'a, T>
Create a new OwnedSlice
from a vector reference
sourceimpl<'a, T> From<OwnedSliceMut<'a, T>> for OwnedSlice<'a, T>
impl<'a, T> From<OwnedSliceMut<'a, T>> for OwnedSlice<'a, T>
Create a new OwnedSlice
from a OwnedSliceMut
sourcefn from(mut_slice: OwnedSliceMut<'a, T>) -> Self
fn from(mut_slice: OwnedSliceMut<'a, T>) -> Self
Converts to this type from the input type.
sourceimpl<'a, T> From<Vec<T, Global>> for OwnedSlice<'a, T>
impl<'a, T> From<Vec<T, Global>> for OwnedSlice<'a, T>
Create a new OwnedSlice
from a vector
sourceimpl<'a, 'it, T> IntoIterator for &'it OwnedSlice<'a, T>
impl<'a, 'it, T> IntoIterator for &'it OwnedSlice<'a, T>
sourceimpl<'a, T> IntoOwned for OwnedSlice<'a, T> where
T: Sized + Clone,
impl<'a, T> IntoOwned for OwnedSlice<'a, T> where
T: Sized + Clone,
sourcefn into_owned(self) -> Self
fn into_owned(self) -> Self
Transfer the current type into an owned type.
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for OwnedSlice<'a, T> where
T: RefUnwindSafe,
impl<'a, T> !Send for OwnedSlice<'a, T>
impl<'a, T> !Sync for OwnedSlice<'a, T>
impl<'a, T> Unpin for OwnedSlice<'a, T> where
T: Unpin,
impl<'a, T> UnwindSafe for OwnedSlice<'a, T> where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
type PreprendResult = Tail
type PreprendResult = Tail
The Resulting TupleList
, of an Prepend::prepend()
call,
including the prepended entry. Read more
sourcefn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.