pub struct ZeroString<const CAP: usize, E: Endian = NativeEndian> { /* private fields */ }Available on crate feature
zero-copy only.Expand description
A zero-copy string type with compile-time known max capacity, stored inline.
Implementations§
Trait Implementations§
Source§impl<'a, const CAP: usize, E: Endian> Arbitrary<'a> for ZeroString<CAP, E>
Available on crate feature fuzzing only.
impl<'a, const CAP: usize, E: Endian> Arbitrary<'a> for ZeroString<CAP, E>
Available on crate feature
fuzzing only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<'de, const CAP: usize, E: Endian, Context> BorrowDecode<'de, Context> for ZeroString<CAP, E>
impl<'de, const CAP: usize, E: Endian, Context> BorrowDecode<'de, Context> for ZeroString<CAP, E>
Source§fn borrow_decode<D: BorrowDecoder<'de, Context = Context>>(
decoder: &mut D,
) -> Result<Self, DecodeError>
fn borrow_decode<D: BorrowDecoder<'de, Context = Context>>( decoder: &mut D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given [
BorrowDecode]. Read moreimpl<const CAP: usize, E: Copy + Endian> Copy for ZeroString<CAP, E>
Source§impl<const CAP: usize, E: Endian, Context> Decode<Context> for ZeroString<CAP, E>
impl<const CAP: usize, E: Endian, Context> Decode<Context> for ZeroString<CAP, E>
Source§impl<const CAP: usize, E: Endian> DeepValidator for ZeroString<CAP, E>
impl<const CAP: usize, E: Endian> DeepValidator for ZeroString<CAP, E>
Source§fn is_valid_deep(&self, _buffer: &[u8]) -> bool
fn is_valid_deep(&self, _buffer: &[u8]) -> bool
Performs a deep validation check on the relative pointer.
Source§impl<const CAP: usize, E: Endian> Encode for ZeroString<CAP, E>
impl<const CAP: usize, E: Endian> Encode for ZeroString<CAP, E>
impl<const CAP: usize, E: Eq + Endian> Eq for ZeroString<CAP, E>
Source§impl<const CAP: usize, E: Endian> StaticSize for ZeroString<CAP, E>
impl<const CAP: usize, E: Endian> StaticSize for ZeroString<CAP, E>
impl<const CAP: usize, E: PartialEq + Endian> StructuralPartialEq for ZeroString<CAP, E>
Source§impl<const CAP: usize, E: Endian> Validator for ZeroString<CAP, E>
impl<const CAP: usize, E: Endian> Validator for ZeroString<CAP, E>
Source§impl<const CAP: usize, E: Endian> ZeroCopy for ZeroString<CAP, E>
impl<const CAP: usize, E: Endian> ZeroCopy for ZeroString<CAP, E>
Source§fn write_repr(&self, dst: &mut [u8])where
Self: Sized,
fn write_repr(&self, dst: &mut [u8])where
Self: Sized,
Writes the object representation of
self into dst (exactly Self::SIZE bytes,
already zero-initialized by the caller). Read moreSource§fn is_valid_repr(bytes: &[u8]) -> bool
fn is_valid_repr(bytes: &[u8]) -> bool
Returns
true if bytes (exactly Self::SIZE bytes, in native representation) form a
valid value of Self. Types with invalid bit patterns (e.g. bool, char) must override
this; it is checked before any reference to Self is created from untrusted bytes.Source§impl<E: Endian, const CAP: usize> ZeroCopyType<E> for ZeroString<CAP, E>
Available on crate feature alloc only.
impl<E: Endian, const CAP: usize> ZeroCopyType<E> for ZeroString<CAP, E>
Available on crate feature
alloc only.Auto Trait Implementations§
impl<const CAP: usize, E> Forget for ZeroString<CAP, E>
impl<const CAP: usize, E> Freeze for ZeroString<CAP, E>
impl<const CAP: usize, E> Move for ZeroString<CAP, E>
impl<const CAP: usize, E> RefUnwindSafe for ZeroString<CAP, E>
impl<const CAP: usize, E> Send for ZeroString<CAP, E>
impl<const CAP: usize, E> Sync for ZeroString<CAP, E>
impl<const CAP: usize, E> Unpin for ZeroString<CAP, E>
impl<const CAP: usize, E> UnsafeUnpin for ZeroString<CAP, E>
impl<const CAP: usize, E> UnwindSafe for ZeroString<CAP, E>
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
Mutably borrows from an owned value. Read more