pub enum Attachment {
Image {
id: String,
width: u32,
height: u32,
bytes: String,
},
Audio {
id: String,
sample_rate: u32,
bytes: String,
},
Video {
id: String,
bytes: String,
},
Unknown,
}Expand description
Re-exports of the v2 wire types per ADR 0015. v2 is shipped as
part of inferd-client 0.2 so consumers building against v2 can
reach the proto types without a separate inferd-proto dep.
One binary attachment in the request’s top-level attachments[] table.
Tagged-enum shape: each variant carries exactly the metadata libmtmd
(and other engines’ multimodal interfaces) need for that modality.
Unknown variants deserialise as Attachment::Unknown so v2.0
clients don’t reject newer payloads at parse time; resolve()
rejects them only when they reach validation.
id must be unique within a single request; content blocks
reference attachments by exactly this string.
bytes is standard-base64-encoded (RFC 4648, with +/ and =
padding). After ~1.33× inflation the raw payload must still leave
room within the 64 MiB per-frame cap.
Variants§
Image
Decoded RGB image. bytes is width * height * 3 interleaved
RGB octets (no alpha channel; consumer drops alpha or
composites against a known background before sending).
Fields
Audio
Decoded audio PCM. bytes is base64 of n_samples * sizeof(f32) little-endian float32 samples at the named
sample rate.
Fields
Video
Reserved. Engine support is a separate concern; v2.0 daemons
reject video attachments with attachment_unsupported until
a video-capable adapter ships. Wire shape is intentionally
kept stub-thin; future revisions add fields without breaking
v2.0 clients (forward-compat: serde will accept extra fields
silently).
Fields
Unknown
Forward-compat escape hatch — any kind value the local build
doesn’t recognise lands here so older clients/daemons don’t
reject newer payloads at parse time. resolve() rejects them
only when they reach validation.
Implementations§
Trait Implementations§
Source§impl Clone for Attachment
impl Clone for Attachment
Source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Attachment
impl Debug for Attachment
Source§impl<'de> Deserialize<'de> for Attachment
impl<'de> Deserialize<'de> for Attachment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Attachment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Attachment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Attachment
impl PartialEq for Attachment
Source§fn eq(&self, other: &Attachment) -> bool
fn eq(&self, other: &Attachment) -> bool
self and other values to be equal, and is used by ==.