Struct sgdata::SGData [−][src]
pub struct SGData(_);
Expand description
Scattered, gathered, immutable, arc-ed data
Allows zero-copy processing of streamed data, read into fixed-size buffers. Especially useful for high-performance, parallel data processing.
A piece of data potentially scattered between multiple parts, which themselves might be slices of shared-ownership underlying data.
SGData
is essentially semantic wrapper over Vec<ArcRef<Vec<u8>, [u8]>>
For illustration:
frames: [ Buf ][ Buf ][ Buf ][ Buf ]
edges: | | | | |
| | | | |
\ /\ / \ / \ /\ /\ / \ /
\ / || || | | \ / \ / \ /
sgdata parts: C1[0] C1[1] C2[0] C3[0] C3[1] C3[2] C4[0]
Arbitrary-sized data is being read into frames
and edges between
logical parts are being found. Then sgdata
objects are created,
aggregating parts of frames
while holding reference-counted shared
ownership over frames
.
Implementations
Convert to linear (single vector) form
If self
is empty or already contains only one piece,
this is cheap.
If self
is scattered between many pices, this requires
copying all the data into a new, big chunk.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SGData
impl UnwindSafe for SGData
Blanket Implementations
Mutably borrows from an owned value. Read more