pub struct CompressedImage {
pub format: String,
pub data: Vec<u8>,
}Expand description
An encoded image frame — std/media/v1/CompressedImage[format=…].
The only parameterised media type whose layout does not vary with its parameter: an encoded stream is opaque bytes whatever the codec, and the codec name rides as row data so a decoder never needs the port’s URN.
Fields§
§format: StringThe codec that produced data (jpeg, png, h264, …).
data: Vec<u8>The encoded bytes.
Implementations§
Trait Implementations§
Source§impl AstrsMessage for CompressedImage
impl AstrsMessage for CompressedImage
Source§const URN: &'static str = "std/media/v1/CompressedImage"
const URN: &'static str = "std/media/v1/CompressedImage"
The type URN this message’s columnar layout is declared against
(blueprint §24.3), e.g.
"std/vision/v1/Detections".Source§fn data_type() -> DataType
fn data_type() -> DataType
The columnar layout
AstrsMessage::to_record_batch produces and
AstrsMessage::from_record_batch expects.Source§fn to_record_batch(&self) -> Result<RecordBatch>
fn to_record_batch(&self) -> Result<RecordBatch>
Encodes one message into a one-row
RecordBatch (blueprint §6.1’s
“one record batch per message”). Read moreSource§fn from_record_batch(batch: &RecordBatch) -> Result<Self>
fn from_record_batch(batch: &RecordBatch) -> Result<Self>
Decodes one message from a one-row
RecordBatch. Read moreSource§fn schema() -> Schema
fn schema() -> Schema
The single-column
Schema wrapping AstrsMessage::data_type
under crate::DATA_COLUMN (blueprint §6.1).Source§fn type_urn() -> Result<TypeUrn, TypeUrnError>
fn type_urn() -> Result<TypeUrn, TypeUrnError>
Parses
AstrsMessage::URN. Read moreSource§impl Clone for CompressedImage
impl Clone for CompressedImage
Source§impl Debug for CompressedImage
impl Debug for CompressedImage
Source§impl Default for CompressedImage
impl Default for CompressedImage
impl Eq for CompressedImage
Source§impl FromPayload for CompressedImage
impl FromPayload for CompressedImage
Source§fn from_batch(batch: &RecordBatch) -> Result<Self>
fn from_batch(batch: &RecordBatch) -> Result<Self>
Reads the value from a decoded payload batch. Read more
Source§impl PartialEq for CompressedImage
impl PartialEq for CompressedImage
impl StructuralPartialEq for CompressedImage
Auto Trait Implementations§
impl Freeze for CompressedImage
impl RefUnwindSafe for CompressedImage
impl Send for CompressedImage
impl Sync for CompressedImage
impl Unpin for CompressedImage
impl UnsafeUnpin for CompressedImage
impl UnwindSafe for CompressedImage
Blanket Implementations§
impl<T> Allocation for T
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