pub struct ImageData {
pub media_type: String,
pub bytes: Vec<u8>,
pub width: Option<u32>,
pub height: Option<u32>,
}Expand description
Raw image bytes plus enough metadata for a renderer to encode them.
cel-brief is provider-agnostic, so we never pre-encode for OpenAI /
Anthropic / local wire formats here. The renderer reads media_type and
the bytes and emits whatever the target API wants (base64 data URL,
multi-part upload, etc.).
Fields§
§media_type: StringIANA media type, e.g. image/png, image/jpeg, image/webp.
bytes: Vec<u8>Raw image bytes.
width: Option<u32>Optional pixel width — populated by sources that know it.
height: Option<u32>Optional pixel height — populated by sources that know it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImageData
impl<'de> Deserialize<'de> for ImageData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ImageData
Auto Trait Implementations§
impl Freeze for ImageData
impl RefUnwindSafe for ImageData
impl Send for ImageData
impl Sync for ImageData
impl Unpin for ImageData
impl UnsafeUnpin for ImageData
impl UnwindSafe for ImageData
Blanket Implementations§
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