pub struct FileBlob<T>where
T: FileKind,{
pub data: Vec<u8>,
/* private fields */
}Fields§
§data: Vec<u8>Implementations§
Trait Implementations§
Source§impl<'a, T> ReadAt<'a> for FileBlob<T>where
T: FileKind,
impl<'a, T> ReadAt<'a> for FileBlob<T>where
T: FileKind,
Source§const MODE: DataType = DataType::Offset
const MODE: DataType = DataType::Offset
Whether the parent table stores this value inline or via a forward offset.
Source§type ReadOutput = FileBlobView<'a, T>
type ReadOutput = FileBlobView<'a, T>
The type returned by
read_at. For scalars this is Self; for strings
it is &'a str; for arrays it is ListView<'a, T>.Source§fn read_at(buf: &'a [u8], offset: usize) -> FileBlobView<'a, T>
fn read_at(buf: &'a [u8], offset: usize) -> FileBlobView<'a, T>
Decode a value from
buf at absolute byte position offset.Source§fn default_output() -> FileBlobView<'a, T>
fn default_output() -> FileBlobView<'a, T>
Return the zero/empty default for this type’s
ReadOutput. Read moreSource§fn payload_block_end(buf: &'a [u8], pos: usize) -> usize
fn payload_block_end(buf: &'a [u8], pos: usize) -> usize
Returns the exclusive end address of the value whose payload starts at
pos. Overridden by Table (→ view.block_end()), Struct (→ pos +
size_of), and String (→ pos + 4 + length). Default returns pos
(safe conservative fallback for scalars/unknown types).fn read_with_tag_at(buf: &'a [u8], offset: usize, _tag: u8) -> Self::ReadOutput
Source§impl<T> Serialize for FileBlob<T>where
T: FileKind,
impl<T> Serialize for FileBlob<T>where
T: FileKind,
const SIZE: usize = 4
const ALIGN: usize = 4
Source§const MODE: DataType = DataType::Offset
const MODE: DataType = DataType::Offset
Whether this value is written inline at the field position (
Inline)
or whether a 32-bit forward offset to the value is written instead
(Offset). This constant is inspected by parent arrays and tables
at compile time to choose the correct write strategy.Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Upper bound on the number of bytes this value and its alignment padding
will consume. Used by
write_to and parent tables to call
ensure_capacity before entering the unchecked fast path.Source§fn write_to<B>(&self, buffer: &mut B) -> usizewhere
B: Buffer,
fn write_to<B>(&self, buffer: &mut B) -> usizewhere
B: Buffer,
Write this value into
buffer, calling ensure_capacity first.
Returns the slot of the outermost written unit (length prefix for arrays,
value start for scalars).Source§fn write_to_unchecked<B>(&self, buffer: &mut B) -> usizewhere
B: Buffer,
fn write_to_unchecked<B>(&self, buffer: &mut B) -> usizewhere
B: Buffer,
Write this value into
buffer without checking capacity first. Read moreSource§fn is_absent(&self) -> bool
fn is_absent(&self) -> bool
Return
true if this value is the default/zero/absent state. Read moreconst ALIGNR: usize = _
const ALIGN_MASK: usize = _
fn tag(&self) -> u8
Auto Trait Implementations§
impl<T> Freeze for FileBlob<T>
impl<T> RefUnwindSafe for FileBlob<T>where
T: RefUnwindSafe,
impl<T> Send for FileBlob<T>where
T: Send,
impl<T> Sync for FileBlob<T>where
T: Sync,
impl<T> Unpin for FileBlob<T>where
T: Unpin,
impl<T> UnsafeUnpin for FileBlob<T>
impl<T> UnwindSafe for FileBlob<T>where
T: 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