pub struct Bytes(pub Vec<u8>);Expand description
A byte-string record that is not treated as a recursive numeric sequence.
Vec<u8> remains available for equal-length sequence collation. Wrap a
byte string in Bytes when each sample must remain one byte record.
§Examples
use rusttorch_data::{Bytes, Collate, DefaultCollator};
let mut collator = DefaultCollator;
let records = collator
.collate(vec![Bytes(vec![1, 2]), Bytes(vec![3])])
.expect("byte records collate");
assert_eq!(records, [Bytes(vec![1, 2]), Bytes(vec![3])]);Tuple Fields§
§0: Vec<u8>Trait Implementations§
Source§impl DefaultCollate for Bytes
impl DefaultCollate for Bytes
Source§impl DefaultConvert for Bytes
impl DefaultConvert for Bytes
Source§fn default_convert(self) -> Result<Self::Output, CollateError>
fn default_convert(self) -> Result<Self::Output, CollateError>
Applies built-in conversion without automatic batching.
impl Eq for Bytes
Source§impl MemoryFootprint for Bytes
impl MemoryFootprint for Bytes
Source§fn resident_bytes(&self) -> usize
fn resident_bytes(&self) -> usize
Returns the conservative logical payload size in bytes.
Source§impl Ord for Bytes
impl Ord for Bytes
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Bytes
impl PartialOrd for Bytes
Source§impl PinMemory for Bytes
impl PinMemory for Bytes
Source§fn pin_memory(self, _device: Device) -> Result<Self>
fn pin_memory(self, _device: Device) -> Result<Self>
Pins this value for the requested accelerator.
impl StructuralPartialEq for Bytes
Auto Trait Implementations§
impl Freeze for Bytes
impl RefUnwindSafe for Bytes
impl Send for Bytes
impl Sync for Bytes
impl Unpin for Bytes
impl UnsafeUnpin for Bytes
impl UnwindSafe for Bytes
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