pub struct ChunkedBytes<C, const MAX: u32 = xdrs::::chunked::ChunkedBytes::{constant#0}>(pub C);Expand description
Variable-length opaque data held as a sequence of byte chunks.
ChunkedBytes<C, MAX> is EncodesAs<BytesM<MAX>>. Each
chunk is anything that is AsRef<[u8]>, such as a Vec<u8>, a &[u8]
or an Arc<[u8]>, and is written straight from its buffer, followed by
one TXS padding for the whole opaque. See the
module documentation.
§Example
use xdrs::{BytesM, ChunkedBytes, txs};
let chunked = ChunkedBytes::<_>(vec![&b"hello, "[..], &b"world"[..]]);
let joined = BytesM::<{ u32::MAX }>(b"hello, world".to_vec());
assert_eq!(txs::encode(&chunked).unwrap(), txs::encode(&joined).unwrap());Tuple Fields§
§0: CImplementations§
Trait Implementations§
Source§impl<C, const MAX: u32> Clone for ChunkedBytes<C, MAX>where
C: Clone,
impl<C, const MAX: u32> Clone for ChunkedBytes<C, MAX>where
C: Clone,
Source§fn clone(&self) -> ChunkedBytes<C, MAX>
fn clone(&self) -> ChunkedBytes<C, MAX>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C, const MAX: u32> ConstMaxSize for ChunkedBytes<C, MAX>
impl<C, const MAX: u32> ConstMaxSize for ChunkedBytes<C, MAX>
Source§impl<C, const MAX: u32> ConstMaxSize for ChunkedBytes<C, MAX>
impl<C, const MAX: u32> ConstMaxSize for ChunkedBytes<C, MAX>
impl<C, const MAX: u32> Copy for ChunkedBytes<C, MAX>where
C: Copy,
Source§impl<C, const MAX: u32> Default for ChunkedBytes<C, MAX>where
C: Default,
impl<C, const MAX: u32> Default for ChunkedBytes<C, MAX>where
C: Default,
Source§fn default() -> ChunkedBytes<C, MAX>
fn default() -> ChunkedBytes<C, MAX>
Returns the “default value” for a type. Read more
impl<C, B, const MAX: u32> EncodesAs<BytesM<MAX>> for ChunkedBytes<C, MAX>
impl<C, B, const MAX: u32> EncodesAs<ChunkedBytes<C, MAX>> for ChunkedBytes<C, MAX>
impl<C, const MAX: u32> Eq for ChunkedBytes<C, MAX>where
C: Eq,
impl<C, const MAX: u32> StructuralPartialEq for ChunkedBytes<C, MAX>where
C: PartialEq,
Source§impl<C, B, const MAX: u32> WriteXDR for ChunkedBytes<C, MAX>
impl<C, B, const MAX: u32> WriteXDR for ChunkedBytes<C, MAX>
Source§fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
Writes this value as XDR data to the writer. Read more
Source§unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
Writes this value as XDR data to the writer, without runtime checks. Read more
Auto Trait Implementations§
impl<C, const MAX: u32> Freeze for ChunkedBytes<C, MAX>where
C: Freeze,
impl<C, const MAX: u32> RefUnwindSafe for ChunkedBytes<C, MAX>where
C: RefUnwindSafe,
impl<C, const MAX: u32> Send for ChunkedBytes<C, MAX>where
C: Send,
impl<C, const MAX: u32> Sync for ChunkedBytes<C, MAX>where
C: Sync,
impl<C, const MAX: u32> Unpin for ChunkedBytes<C, MAX>where
C: Unpin,
impl<C, const MAX: u32> UnsafeUnpin for ChunkedBytes<C, MAX>where
C: UnsafeUnpin,
impl<C, const MAX: u32> UnwindSafe for ChunkedBytes<C, MAX>where
C: 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