pub struct Array<'a, L, T>where
T: DecoderFor<'a, T>,{ /* private fields */ }
Expand description
A count-prefixed array.
Implementations§
Source§impl<'a, T, L> Array<'a, L, T>where
T: DecoderFor<'a, T>,
impl<'a, T, L> Array<'a, L, T>where
T: DecoderFor<'a, T>,
Source§impl<'a, T, L> Array<'a, L, T>where
T: DataTypeFixedSize + DecoderFor<'a, T>,
impl<'a, T, L> Array<'a, L, T>where
T: DataTypeFixedSize + DecoderFor<'a, T>,
Trait Implementations§
Source§impl<'a, T, L> ArrayExt<'a> for Array<'a, L, T>where
T: DecoderFor<'a, T>,
L: 'a,
impl<'a, T, L> ArrayExt<'a> for Array<'a, L, T>where
T: DecoderFor<'a, T>,
L: 'a,
Source§fn into_slice(self) -> &'a [u8] ⓘ
fn into_slice(self) -> &'a [u8] ⓘ
Convert the array into a slice of bytes.
Source§impl<'a, L, T> DataType for Array<'a, L, T>
impl<'a, L, T> DataType for Array<'a, L, T>
const META: StructFieldMeta
fn encode_usize(buf: &mut BufWriter<'_>, value: usize)
fn decode_usize(buf: &mut &[u8]) -> Result<usize, ParseError>
Source§impl<'a, L, T> DecoderFor<'a, Array<'a, L, T>> for Array<'a, L, T>
impl<'a, L, T> DecoderFor<'a, Array<'a, L, T>> for Array<'a, L, T>
fn decode_for(buf: &mut &'a [u8]) -> Result<Array<'a, L, T>, ParseError>
Source§impl<T, L, IT> EncoderFor<Array<'static, L, T>> for &[IT]
Slice encoder
impl<T, L, IT> EncoderFor<Array<'static, L, T>> for &[IT]
Slice encoder
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T, L, const N: usize, IT> EncoderFor<Array<'static, L, T>> for &[IT; N]
Array reference encoder
impl<T, L, const N: usize, IT> EncoderFor<Array<'static, L, T>> for &[IT; N]
Array reference encoder
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T, L, IT> EncoderFor<Array<'static, L, T>> for &Vec<IT>
Direct &Vec encoder
impl<T, L, IT> EncoderFor<Array<'static, L, T>> for &Vec<IT>
Direct &Vec
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T, L, const N: usize, IT> EncoderFor<Array<'static, L, T>> for [IT; N]
Array encoder
impl<T, L, const N: usize, IT> EncoderFor<Array<'static, L, T>> for [IT; N]
Array encoder
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T, L> EncoderFor<Array<'static, L, T>> for Array<'static, L, T>
Self encoder
impl<T, L> EncoderFor<Array<'static, L, T>> for Array<'static, L, T>
Self encoder
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T, L, F, I, II, IT> EncoderFor<Array<'static, L, T>> for Fwhere
T: DataType + DecoderFor<'static, T>,
L: DataType + 'static,
F: Fn() -> I,
I: IntoIterator<Item = IT, IntoIter = II>,
IT: EncoderFor<T>,
II: ExactSizeIterator<Item = IT>,
Function encoder: see the note about about non-restartable iterators.
impl<T, L, F, I, II, IT> EncoderFor<Array<'static, L, T>> for Fwhere
T: DataType + DecoderFor<'static, T>,
L: DataType + 'static,
F: Fn() -> I,
I: IntoIterator<Item = IT, IntoIter = II>,
IT: EncoderFor<T>,
II: ExactSizeIterator<Item = IT>,
Function encoder: see the note about about non-restartable iterators.
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T, L, IT> EncoderFor<Array<'static, L, T>> for Vec<IT>
Direct Vec encoder
impl<T, L, IT> EncoderFor<Array<'static, L, T>> for Vec<IT>
Direct Vec
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a, T, L> IntoIterator for &Array<'a, L, T>where
T: DecoderFor<'a, T>,
impl<'a, T, L> IntoIterator for &Array<'a, L, T>where
T: DecoderFor<'a, T>,
Source§impl<'a, T, L> IntoIterator for Array<'a, L, T>where
T: DecoderFor<'a, T>,
impl<'a, T, L> IntoIterator for Array<'a, L, T>where
T: DecoderFor<'a, T>,
Source§impl<'a, L, const N: usize> PartialEq<&[u8; N]> for Array<'a, L, u8>
Arrays of u8
can be compared to fixed-size slices.
impl<'a, L, const N: usize> PartialEq<&[u8; N]> for Array<'a, L, u8>
Arrays of u8
can be compared to fixed-size slices.
impl<'a, L, T> Copy for Array<'a, L, T>
Auto Trait Implementations§
impl<'a, L, T> Freeze for Array<'a, L, T>
impl<'a, L, T> RefUnwindSafe for Array<'a, L, T>where
T: RefUnwindSafe,
L: RefUnwindSafe,
impl<'a, L, T> Send for Array<'a, L, T>
impl<'a, L, T> Sync for Array<'a, L, T>
impl<'a, L, T> Unpin for Array<'a, L, T>
impl<'a, L, T> UnwindSafe for Array<'a, L, T>where
T: UnwindSafe,
L: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EncoderFor<Rest<'static>> for T
impl<T> EncoderFor<Rest<'static>> for T
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<T> EncoderForExt for Twhere
T: ?Sized,
impl<T> EncoderForExt for Twhere
T: ?Sized,
Source§fn to_vec<F>(&self) -> Vec<u8> ⓘwhere
F: 'static,
Self: EncoderFor<F>,
fn to_vec<F>(&self) -> Vec<u8> ⓘwhere
F: 'static,
Self: EncoderFor<F>,
Convert this builder into a vector of bytes. This is generally
not the most efficient way to perform serialization.
Source§fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>where
F: 'static,
Self: EncoderFor<F>,
fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>where
F: 'static,
Self: EncoderFor<F>,
Encode this builder into a given buffer. If the buffer is
too small, the function will return the number of bytes
required to encode the builder.
Source§fn encode_buffer_uninit<'a, F>(
&self,
buf: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], usize>where
F: 'static,
Self: EncoderFor<F>,
fn encode_buffer_uninit<'a, F>(
&self,
buf: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], usize>where
F: 'static,
Self: EncoderFor<F>,
Encode this builder into a given buffer. If the buffer is
too small, the function will return the number of bytes
required to encode the builder.