pub struct SmallArcSlice<S: Slice<Item = u8> + ?Sized, L: Layout = DefaultLayout>(/* private fields */);inlined only.Expand description
A wrapper enabling small string optimization into ArcSlice.
It can store up to size_of::<ArcBytes<L>>() - 2 bytes inline, without allocating.
However, the niche optimization of ArcSlice is lost, which means that
size_of::<Option<SmallArcBytes<L>>>() == size_of::<SmallArcBytes<L>>() + size_of::<usize>().
Implementations§
Source§impl<S: Slice<Item = u8> + ?Sized, L: Layout> SmallArcSlice<S, L>
impl<S: Slice<Item = u8> + ?Sized, L: Layout> SmallArcSlice<S, L>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new empty SmallArcSlice.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::new();
assert_eq!(s, []);Sourcepub fn from_slice(slice: &S) -> Self
Available on crate feature oom-handling only.
pub fn from_slice(slice: &S) -> Self
oom-handling only.Creates a new SmallArcSlice by copying the given slice.
The slice will be stored inlined if it can fit into a SmallSlice.
§Panics
Panics if the new capacity exceeds isize::MAX - size_of::<usize>() bytes.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::from_slice(b"hello world");
assert_eq!(s, b"hello world");Sourcepub fn try_from_slice(slice: &S) -> Result<Self, AllocError>
pub fn try_from_slice(slice: &S) -> Result<Self, AllocError>
Tries creating a new SmallArcSlice by copying the given slice, returning an error if the
allocation fails.
The slice will be stored inlined if it can fit into a SmallSlice.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::try_from_slice(b"hello world")?;
assert_eq!(s, b"hello world");Sourcepub fn as_either(&self) -> Either<&SmallSlice<S, L>, &ArcSlice<S, L>>
pub fn as_either(&self) -> Either<&SmallSlice<S, L>, &ArcSlice<S, L>>
Returns either a reference to the inlined SmallSlice storage, or to the ArcSlice
one.
§Examples
use arc_slice::inlined::SmallArcSlice;
use either::Either;
let s = SmallArcSlice::<[u8]>::new();
assert!(matches!(s.as_either(), Either::Left(_)));
let s = SmallArcSlice::<[u8]>::from_array([0; 256]);
assert!(matches!(s.as_either(), Either::Right(_)));Sourcepub fn as_either_mut(
&mut self,
) -> Either<&mut SmallSlice<S, L>, &mut ArcSlice<S, L>>
pub fn as_either_mut( &mut self, ) -> Either<&mut SmallSlice<S, L>, &mut ArcSlice<S, L>>
Returns either a mutable reference to the inlined SmallSlice storage, or to the
ArcSlice one.
§Examples
use arc_slice::inlined::SmallArcSlice;
use either::Either;
let mut s = SmallArcSlice::<[u8]>::new();
assert!(matches!(s.as_either_mut(), Either::Left(_)));
let mut s = SmallArcSlice::<[u8]>::from_array([0; 256]);
assert!(matches!(s.as_either_mut(), Either::Right(_)));Sourcepub fn into_either(self) -> Either<SmallSlice<S, L>, ArcSlice<S, L>>
pub fn into_either(self) -> Either<SmallSlice<S, L>, ArcSlice<S, L>>
Returns either the inlined SmallSlice storage, or the ArcSlice one.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of items in the slice.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::from(&[0, 1, 2]);
assert_eq!(s.len(), 3);Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the slice contains no items.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::from(&[0, 1, 2]);
assert!(!s.is_empty());
let s = SmallArcSlice::<[u8]>::from(&[]);
assert!(s.is_empty());Sourcepub fn as_ptr(&self) -> *const u8
pub fn as_ptr(&self) -> *const u8
Returns a raw pointer to the slice’s first item.
See slice::as_ptr.
Sourcepub fn try_clone(&self) -> Result<Self, AllocError>
pub fn try_clone(&self) -> Result<Self, AllocError>
Tries cloning the SmallArcSlice, returning an error if an allocation fails.
The operation may allocate. See CloneNoAllocLayout
documentation for cases where it does not.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::try_from_slice(b"hello world")?;
let s2 = s.try_clone()?;
assert_eq!(s2, b"hello world");Sourcepub fn try_subslice(
&self,
range: impl RangeBounds<usize>,
) -> Result<Self, AllocError>where
S: Subsliceable,
pub fn try_subslice(
&self,
range: impl RangeBounds<usize>,
) -> Result<Self, AllocError>where
S: Subsliceable,
Tries extracting a subslice of an SmallArcSlice with a given range, returning an error
if an allocation fails.
The operation may allocate. See CloneNoAllocLayout
documentation for cases where it does not.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::try_from_slice(b"hello world")?;
let s2 = s.try_subslice(..5)?;
assert_eq!(s2, b"hello");Source§impl<L: Layout> SmallArcSlice<[u8], L>
impl<L: Layout> SmallArcSlice<[u8], L>
Sourcepub fn from_array<const N: usize>(array: [u8; N]) -> Self
Available on crate feature oom-handling only.
pub fn from_array<const N: usize>(array: [u8; N]) -> Self
oom-handling only.Sourcepub fn try_from_array<const N: usize>(array: [u8; N]) -> Result<Self, [u8; N]>
pub fn try_from_array<const N: usize>(array: [u8; N]) -> Result<Self, [u8; N]>
Tries creating a new SmallArcSlice by moving the given array, returning it if an
allocation fails.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::try_from_array([0, 1, 2]).unwrap();
assert_eq!(s, [0, 1, 2]);Source§impl<S: Slice<Item = u8> + ?Sized, L: Layout> SmallArcSlice<S, L>
impl<S: Slice<Item = u8> + ?Sized, L: Layout> SmallArcSlice<S, L>
Sourcepub fn subslice(&self, range: impl RangeBounds<usize>) -> Selfwhere
S: Subsliceable,
pub fn subslice(&self, range: impl RangeBounds<usize>) -> Selfwhere
S: Subsliceable,
Extracts a subslice of an SmallArcSlice with a given range.
§Examples
use arc_slice::inlined::SmallArcSlice;
let s = SmallArcSlice::<[u8]>::from_slice(b"hello world");
let s2 = s.subslice(..5);
assert_eq!(s2, b"hello");Source§impl<L: StaticLayout> SmallArcSlice<[u8], L>
impl<L: StaticLayout> SmallArcSlice<[u8], L>
Sourcepub const fn from_static(slice: &'static [u8]) -> SmallArcSlice<[u8], L>
pub const fn from_static(slice: &'static [u8]) -> SmallArcSlice<[u8], L>
Creates a new SmallArcSlice from a static slice.
The operation never allocates.
§Examples
use arc_slice::{inlined::SmallArcSlice, layout::ArcLayout};
static HELLO_WORLD: SmallArcSlice<[u8], ArcLayout<true, true>> =
SmallArcSlice::<[u8], ArcLayout<true, true>>::from_static(b"hello world");Source§impl<L: StaticLayout> SmallArcSlice<str, L>
impl<L: StaticLayout> SmallArcSlice<str, L>
Sourcepub const fn from_static(slice: &'static str) -> SmallArcSlice<str, L>
pub const fn from_static(slice: &'static str) -> SmallArcSlice<str, L>
Creates a new SmallArcSlice from a static slice.
The operation never allocates.
§Examples
use arc_slice::{inlined::SmallArcSlice, layout::ArcLayout};
static HELLO_WORLD: SmallArcSlice<[u8], ArcLayout<true, true>> =
SmallArcSlice::<[u8], ArcLayout<true, true>>::from_static(b"hello world");Trait Implementations§
Source§impl<S: Slice<Item = u8> + Subsliceable + ?Sized, L: Layout> Buf for SmallArcSlice<S, L>
Available on crate feature bytes only.
impl<S: Slice<Item = u8> + Subsliceable + ?Sized, L: Layout> Buf for SmallArcSlice<S, L>
bytes only.Source§fn remaining(&self) -> usize
fn remaining(&self) -> usize
Source§fn chunk(&self) -> &[u8] ⓘ
fn chunk(&self) -> &[u8] ⓘ
Buf::remaining(). Note that this can return a shorter slice (this
allows non-continuous internal representation). Read moreSource§fn has_remaining(&self) -> bool
fn has_remaining(&self) -> bool
Source§fn copy_to_slice(&mut self, dst: &mut [u8])
fn copy_to_slice(&mut self, dst: &mut [u8])
Source§fn get_u16(&mut self) -> u16
fn get_u16(&mut self) -> u16
self in big-endian byte order. Read moreSource§fn get_u16_le(&mut self) -> u16
fn get_u16_le(&mut self) -> u16
self in little-endian byte order. Read moreSource§fn get_u16_ne(&mut self) -> u16
fn get_u16_ne(&mut self) -> u16
self in native-endian byte order. Read moreSource§fn get_i16(&mut self) -> i16
fn get_i16(&mut self) -> i16
self in big-endian byte order. Read moreSource§fn get_i16_le(&mut self) -> i16
fn get_i16_le(&mut self) -> i16
self in little-endian byte order. Read moreSource§fn get_i16_ne(&mut self) -> i16
fn get_i16_ne(&mut self) -> i16
self in native-endian byte order. Read moreSource§fn get_u32(&mut self) -> u32
fn get_u32(&mut self) -> u32
self in the big-endian byte order. Read moreSource§fn get_u32_le(&mut self) -> u32
fn get_u32_le(&mut self) -> u32
self in the little-endian byte order. Read moreSource§fn get_u32_ne(&mut self) -> u32
fn get_u32_ne(&mut self) -> u32
self in native-endian byte order. Read moreSource§fn get_i32(&mut self) -> i32
fn get_i32(&mut self) -> i32
self in big-endian byte order. Read moreSource§fn get_i32_le(&mut self) -> i32
fn get_i32_le(&mut self) -> i32
self in little-endian byte order. Read moreSource§fn get_i32_ne(&mut self) -> i32
fn get_i32_ne(&mut self) -> i32
self in native-endian byte order. Read moreSource§fn get_u64(&mut self) -> u64
fn get_u64(&mut self) -> u64
self in big-endian byte order. Read moreSource§fn get_u64_le(&mut self) -> u64
fn get_u64_le(&mut self) -> u64
self in little-endian byte order. Read moreSource§fn get_u64_ne(&mut self) -> u64
fn get_u64_ne(&mut self) -> u64
self in native-endian byte order. Read moreSource§fn get_i64(&mut self) -> i64
fn get_i64(&mut self) -> i64
self in big-endian byte order. Read moreSource§fn get_i64_le(&mut self) -> i64
fn get_i64_le(&mut self) -> i64
self in little-endian byte order. Read moreSource§fn get_i64_ne(&mut self) -> i64
fn get_i64_ne(&mut self) -> i64
self in native-endian byte order. Read moreSource§fn get_u128(&mut self) -> u128
fn get_u128(&mut self) -> u128
self in big-endian byte order. Read moreSource§fn get_u128_le(&mut self) -> u128
fn get_u128_le(&mut self) -> u128
self in little-endian byte order. Read moreSource§fn get_u128_ne(&mut self) -> u128
fn get_u128_ne(&mut self) -> u128
self in native-endian byte order. Read moreSource§fn get_i128(&mut self) -> i128
fn get_i128(&mut self) -> i128
self in big-endian byte order. Read moreSource§fn get_i128_le(&mut self) -> i128
fn get_i128_le(&mut self) -> i128
self in little-endian byte order. Read moreSource§fn get_i128_ne(&mut self) -> i128
fn get_i128_ne(&mut self) -> i128
self in native-endian byte order. Read moreSource§fn get_uint(&mut self, nbytes: usize) -> u64
fn get_uint(&mut self, nbytes: usize) -> u64
self in big-endian byte order. Read moreSource§fn get_uint_le(&mut self, nbytes: usize) -> u64
fn get_uint_le(&mut self, nbytes: usize) -> u64
self in little-endian byte order. Read moreSource§fn get_uint_ne(&mut self, nbytes: usize) -> u64
fn get_uint_ne(&mut self, nbytes: usize) -> u64
self in native-endian byte order. Read moreSource§fn get_int(&mut self, nbytes: usize) -> i64
fn get_int(&mut self, nbytes: usize) -> i64
self in big-endian byte order. Read moreSource§fn get_int_le(&mut self, nbytes: usize) -> i64
fn get_int_le(&mut self, nbytes: usize) -> i64
self in little-endian byte order. Read moreSource§fn get_int_ne(&mut self, nbytes: usize) -> i64
fn get_int_ne(&mut self, nbytes: usize) -> i64
self in native-endian byte order. Read moreSource§fn get_f32(&mut self) -> f32
fn get_f32(&mut self) -> f32
self in big-endian byte order. Read moreSource§fn get_f32_le(&mut self) -> f32
fn get_f32_le(&mut self) -> f32
self in little-endian byte order. Read moreSource§fn get_f32_ne(&mut self) -> f32
fn get_f32_ne(&mut self) -> f32
self in native-endian byte order. Read moreSource§fn get_f64(&mut self) -> f64
fn get_f64(&mut self) -> f64
self in big-endian byte order. Read moreSource§fn get_f64_le(&mut self) -> f64
fn get_f64_le(&mut self) -> f64
self in little-endian byte order. Read moreSource§fn get_f64_ne(&mut self) -> f64
fn get_f64_ne(&mut self) -> f64
self in native-endian byte order. Read moreSource§fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), TryGetError>
fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), TryGetError>
Source§fn try_get_u8(&mut self) -> Result<u8, TryGetError>
fn try_get_u8(&mut self) -> Result<u8, TryGetError>
self. Read moreSource§fn try_get_i8(&mut self) -> Result<i8, TryGetError>
fn try_get_i8(&mut self) -> Result<i8, TryGetError>
self. Read moreSource§fn try_get_u16(&mut self) -> Result<u16, TryGetError>
fn try_get_u16(&mut self) -> Result<u16, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_u16_le(&mut self) -> Result<u16, TryGetError>
fn try_get_u16_le(&mut self) -> Result<u16, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_u16_ne(&mut self) -> Result<u16, TryGetError>
fn try_get_u16_ne(&mut self) -> Result<u16, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_i16(&mut self) -> Result<i16, TryGetError>
fn try_get_i16(&mut self) -> Result<i16, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_i16_le(&mut self) -> Result<i16, TryGetError>
fn try_get_i16_le(&mut self) -> Result<i16, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_i16_ne(&mut self) -> Result<i16, TryGetError>
fn try_get_i16_ne(&mut self) -> Result<i16, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_u32(&mut self) -> Result<u32, TryGetError>
fn try_get_u32(&mut self) -> Result<u32, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_u32_le(&mut self) -> Result<u32, TryGetError>
fn try_get_u32_le(&mut self) -> Result<u32, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_u32_ne(&mut self) -> Result<u32, TryGetError>
fn try_get_u32_ne(&mut self) -> Result<u32, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_i32(&mut self) -> Result<i32, TryGetError>
fn try_get_i32(&mut self) -> Result<i32, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_i32_le(&mut self) -> Result<i32, TryGetError>
fn try_get_i32_le(&mut self) -> Result<i32, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_i32_ne(&mut self) -> Result<i32, TryGetError>
fn try_get_i32_ne(&mut self) -> Result<i32, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_u64(&mut self) -> Result<u64, TryGetError>
fn try_get_u64(&mut self) -> Result<u64, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_u64_le(&mut self) -> Result<u64, TryGetError>
fn try_get_u64_le(&mut self) -> Result<u64, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_u64_ne(&mut self) -> Result<u64, TryGetError>
fn try_get_u64_ne(&mut self) -> Result<u64, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_i64(&mut self) -> Result<i64, TryGetError>
fn try_get_i64(&mut self) -> Result<i64, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_i64_le(&mut self) -> Result<i64, TryGetError>
fn try_get_i64_le(&mut self) -> Result<i64, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_i64_ne(&mut self) -> Result<i64, TryGetError>
fn try_get_i64_ne(&mut self) -> Result<i64, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_u128(&mut self) -> Result<u128, TryGetError>
fn try_get_u128(&mut self) -> Result<u128, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_u128_le(&mut self) -> Result<u128, TryGetError>
fn try_get_u128_le(&mut self) -> Result<u128, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_u128_ne(&mut self) -> Result<u128, TryGetError>
fn try_get_u128_ne(&mut self) -> Result<u128, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_i128(&mut self) -> Result<i128, TryGetError>
fn try_get_i128(&mut self) -> Result<i128, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_i128_le(&mut self) -> Result<i128, TryGetError>
fn try_get_i128_le(&mut self) -> Result<i128, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_i128_ne(&mut self) -> Result<i128, TryGetError>
fn try_get_i128_ne(&mut self) -> Result<i128, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_uint(&mut self, nbytes: usize) -> Result<u64, TryGetError>
fn try_get_uint(&mut self, nbytes: usize) -> Result<u64, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_uint_le(&mut self, nbytes: usize) -> Result<u64, TryGetError>
fn try_get_uint_le(&mut self, nbytes: usize) -> Result<u64, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_uint_ne(&mut self, nbytes: usize) -> Result<u64, TryGetError>
fn try_get_uint_ne(&mut self, nbytes: usize) -> Result<u64, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_int(&mut self, nbytes: usize) -> Result<i64, TryGetError>
fn try_get_int(&mut self, nbytes: usize) -> Result<i64, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_int_le(&mut self, nbytes: usize) -> Result<i64, TryGetError>
fn try_get_int_le(&mut self, nbytes: usize) -> Result<i64, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_int_ne(&mut self, nbytes: usize) -> Result<i64, TryGetError>
fn try_get_int_ne(&mut self, nbytes: usize) -> Result<i64, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_f32(&mut self) -> Result<f32, TryGetError>
fn try_get_f32(&mut self) -> Result<f32, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_f32_le(&mut self) -> Result<f32, TryGetError>
fn try_get_f32_le(&mut self) -> Result<f32, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_f32_ne(&mut self) -> Result<f32, TryGetError>
fn try_get_f32_ne(&mut self) -> Result<f32, TryGetError>
self in native-endian byte order. Read moreSource§fn try_get_f64(&mut self) -> Result<f64, TryGetError>
fn try_get_f64(&mut self) -> Result<f64, TryGetError>
self in big-endian byte order. Read moreSource§fn try_get_f64_le(&mut self) -> Result<f64, TryGetError>
fn try_get_f64_le(&mut self) -> Result<f64, TryGetError>
self in little-endian byte order. Read moreSource§fn try_get_f64_ne(&mut self) -> Result<f64, TryGetError>
fn try_get_f64_ne(&mut self) -> Result<f64, TryGetError>
self in native-endian byte order. Read moreSource§fn copy_to_bytes(&mut self, len: usize) -> Bytes
fn copy_to_bytes(&mut self, len: usize) -> Bytes
Source§impl<'de, S: Slice<Item = u8> + Deserializable + ?Sized, L: LayoutMut> Deserialize<'de> for SmallArcSlice<S, L>where
S::TryFromSliceError: Display,
Available on crate feature serde only.
impl<'de, S: Slice<Item = u8> + Deserializable + ?Sized, L: LayoutMut> Deserialize<'de> for SmallArcSlice<S, L>where
S::TryFromSliceError: Display,
serde only.Source§fn 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>,
Source§impl<L: AnyBufferLayout, const N: usize> From<&[u8; N]> for SmallArcSlice<[u8], L>
Available on crate feature oom-handling only.
impl<L: AnyBufferLayout, const N: usize> From<&[u8; N]> for SmallArcSlice<[u8], L>
oom-handling only.Source§impl<S: Slice<Item = u8> + ?Sized, L: AnyBufferLayout> From<&S> for SmallArcSlice<S, L>
Available on crate feature oom-handling only.
impl<S: Slice<Item = u8> + ?Sized, L: AnyBufferLayout> From<&S> for SmallArcSlice<S, L>
oom-handling only.Source§impl<L: AnyBufferLayout, const N: usize> From<[u8; N]> for SmallArcSlice<[u8], L>
Available on crate feature oom-handling only.
impl<L: AnyBufferLayout, const N: usize> From<[u8; N]> for SmallArcSlice<[u8], L>
oom-handling only.Source§impl<S: Slice<Item = u8> + ?Sized, L: AnyBufferLayout> From<Box<S>> for SmallArcSlice<S, L>
Available on crate feature oom-handling only.
impl<S: Slice<Item = u8> + ?Sized, L: AnyBufferLayout> From<Box<S>> for SmallArcSlice<S, L>
oom-handling only.Source§impl<S: Slice<Item = u8> + ?Sized, L: Layout> From<SmallSlice<S, L>> for SmallArcSlice<S, L>
impl<S: Slice<Item = u8> + ?Sized, L: Layout> From<SmallSlice<S, L>> for SmallArcSlice<S, L>
Source§fn from(value: SmallSlice<S, L>) -> Self
fn from(value: SmallSlice<S, L>) -> Self
Source§impl<L: AnyBufferLayout> From<String> for SmallArcSlice<str, L>
Available on crate feature oom-handling only.
impl<L: AnyBufferLayout> From<String> for SmallArcSlice<str, L>
oom-handling only.Source§impl<L: AnyBufferLayout> From<Vec<u8>> for SmallArcSlice<[u8], L>
Available on crate feature oom-handling only.
impl<L: AnyBufferLayout> From<Vec<u8>> for SmallArcSlice<[u8], L>
oom-handling only.Source§impl<L: Layout> FromStr for SmallArcSlice<str, L>
Available on crate feature oom-handling only.
impl<L: Layout> FromStr for SmallArcSlice<str, L>
oom-handling only.Source§impl<S: Ord + Slice<Item = u8> + ?Sized, L: Layout> Ord for SmallArcSlice<S, L>
impl<S: Ord + Slice<Item = u8> + ?Sized, L: Layout> Ord for SmallArcSlice<S, L>
Source§fn cmp(&self, other: &SmallArcSlice<S, L>) -> Ordering
fn cmp(&self, other: &SmallArcSlice<S, L>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a, S: PartialEq + Slice<Item = u8> + ?Sized, L: Layout> PartialEq<&'a S> for SmallArcSlice<S, L>
impl<'a, S: PartialEq + Slice<Item = u8> + ?Sized, L: Layout> PartialEq<&'a S> for SmallArcSlice<S, L>
Source§impl<S: PartialEq + Slice<Item = u8> + ?Sized, L: Layout> PartialEq<S> for SmallArcSlice<S, L>
impl<S: PartialEq + Slice<Item = u8> + ?Sized, L: Layout> PartialEq<S> for SmallArcSlice<S, L>
Source§impl<S: PartialOrd + Slice<Item = u8> + ?Sized, L: Layout> PartialOrd for SmallArcSlice<S, L>
impl<S: PartialOrd + Slice<Item = u8> + ?Sized, L: Layout> PartialOrd for SmallArcSlice<S, L>
Source§impl<S: Serialize + Slice<Item = u8> + ?Sized, L: Layout> Serialize for SmallArcSlice<S, L>
Available on crate feature serde only.
impl<S: Serialize + Slice<Item = u8> + ?Sized, L: Layout> Serialize for SmallArcSlice<S, L>
serde only.impl<S: PartialEq + Slice<Item = u8> + ?Sized, L: Layout> Eq for SmallArcSlice<S, L>
Auto Trait Implementations§
impl<S, L> Freeze for SmallArcSlice<S, L>
impl<S, L> RefUnwindSafe for SmallArcSlice<S, L>where
<L as InlinedLayout>::Data: RefUnwindSafe,
S: RefUnwindSafe + ?Sized,
<L as ArcSliceLayout>::Data: RefUnwindSafe,
impl<S, L> Send for SmallArcSlice<S, L>
impl<S, L> Sync for SmallArcSlice<S, L>
impl<S, L> Unpin for SmallArcSlice<S, L>
impl<S, L> UnwindSafe for SmallArcSlice<S, L>where
<L as InlinedLayout>::Data: UnwindSafe,
S: UnwindSafe + ?Sized,
<L as ArcSliceLayout>::Data: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more