pub fn export(
t: &TensorDyn,
mode: TransportMode,
) -> Result<(Vec<u8>, Vec<RawFd>)>Expand description
Serialize a tensor to a blob in the requested transport mode.
Returns the blob and its fd table. The two travel together and are
meaningless apart: a plane’s handle is an index into the table, because a
raw fd number does not survive a process boundary.
Export borrows and performs no syscalls. In TransportMode::Reference
the fds in the table are the source tensor’s own, valid only while it lives;
dup happens on import, never here. That is what makes export cheap and
removes any keepalive protocol between producer and consumer.