pub struct BlobHeader {Show 14 fields
pub size: u64,
pub required_mask: u64,
pub planes_bytes: u64,
pub storage_kind: u32,
pub pid: u32,
pub fence_fd: i32,
pub dtype: u32,
pub quant_axis: i32,
pub ndim: u32,
pub plane_count: u32,
pub quant_scales_len: u32,
pub quant_zero_points_len: u32,
pub strings_bytes: u32,
pub strides_len: u32,
}Expand description
The blob’s fixed header. See the module docs for the byte layout.
Field order here mirrors the byte layout so the two can be read side by
side, but this struct is never cast to or from bytes — see Self::write_to
and parse_header, which go field by field in explicit little-endian.
Fields§
§size: u64Total bytes of this blob, header included. The size prefix that makes
the format append-only: an older consumer reads the prefix it knows and
skips to size.
required_mask: u64Bits describing additions that change interpretation rather than adding information. Any bit a consumer does not recognise means refuse.
planes_bytes: u64Byte length of the planes region.
storage_kind: u32Backing store for the whole tensor; the shared TensorMemory code.
pid: u32Producer pid, for pidfd_open/pidfd_getfd and, on Windows, for
OpenProcess(PROCESS_DUP_HANDLE). Zero when all planes are inlined,
where there is no handle to reopen.
Trust boundary. This value and the handle values beside it come
out of the blob, so a hostile one makes an importer probe a pid it
chose and a handle slot in that process. That is the whole of what it
buys: the import asks for PROCESS_DUP_HANDLE alone, and hands the
duplicate only to OpenSharedResource1 / OpenSharedFence, which
refuse anything that is not a shareable D3D11 object. Nothing here
makes a blob safe to accept from an untrusted peer – import blobs
from peers you would already hand a texture to.
fence_fd: i32Acquire fence, or -1 for none. Per-tensor, never per-plane.
dtype: u32Element type; the shared DType code.
quant_axis: i32Per-channel quantization axis; -1 per-tensor, -2 none.
ndim: u32Number of dimensions in the addressing grid.
plane_count: u32Number of plane records in the planes region.
quant_scales_len: u32Number of f32 quantization scales.
quant_zero_points_len: u32Number of i32 zero points; zero means symmetric.
strings_bytes: u32Byte length of the five-string region.
strides_len: u32Number of stride entries: ndim, or 0 meaning densely packed C-order.
Carried rather than assumed — an empty stride array is a distinct value
per Tensor.msg, not an absent one, and flattening the two would break
the reference-mode round-trip identity.
Implementations§
Trait Implementations§
Source§impl Clone for BlobHeader
impl Clone for BlobHeader
Source§fn clone(&self) -> BlobHeader
fn clone(&self) -> BlobHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BlobHeader
Source§impl Debug for BlobHeader
impl Debug for BlobHeader
Source§impl Default for BlobHeader
impl Default for BlobHeader
Source§fn default() -> BlobHeader
fn default() -> BlobHeader
impl Eq for BlobHeader
Source§impl PartialEq for BlobHeader
impl PartialEq for BlobHeader
impl StructuralPartialEq for BlobHeader
Auto Trait Implementations§
impl Freeze for BlobHeader
impl RefUnwindSafe for BlobHeader
impl Send for BlobHeader
impl Sync for BlobHeader
impl Unpin for BlobHeader
impl UnsafeUnpin for BlobHeader
impl UnwindSafe for BlobHeader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more