pub struct AttachmentPacket<E, D> { /* private fields */ }Expand description
An attachment packet — a whole file carried inside the container.
No timestamps. A font or a cover image is not on the timeline;
it is present for the whole file or not at all. Its identity — the
filename it was attached under, its MIME type — is not repeated here
either: that belongs to the track, and lives on TrackInfo.
PacketFlags is kept because CORRUPT still means something for
a payload that failed to read.
Clone and Debug derive directly — see VideoPacket’s docs
for why the per-parameter bound this produces is already precise.
Implementations§
Source§impl<E, D> AttachmentPacket<E, D>
impl<E, D> AttachmentPacket<E, D>
Sourcepub const fn new(data: D, extra: E) -> Self
pub const fn new(data: D, extra: E) -> Self
Constructs an AttachmentPacket from data and extra. Flags
default to empty.
Sourcepub const fn flags(&self) -> PacketFlags
pub const fn flags(&self) -> PacketFlags
Returns the packet flags.
Sourcepub fn extra_mut(&mut self) -> &mut E
pub fn extra_mut(&mut self) -> &mut E
Returns a mutable reference to the backend-specific extras.
Sourcepub fn into_parts(self) -> (D, E)
pub fn into_parts(self) -> (D, E)
Consumes the packet and returns (buffer, extras).
Sourcepub const fn with_flags(self, v: PacketFlags) -> Self
pub const fn with_flags(self, v: PacketFlags) -> Self
Sets the flags (consuming builder).
Sourcepub const fn set_flags(&mut self, v: PacketFlags) -> &mut Self
pub const fn set_flags(&mut self, v: PacketFlags) -> &mut Self
Sets the flags in place.