#[non_exhaustive]pub enum ResourceInput<'a> {
Text {
title: Option<&'a str>,
text: &'a str,
},
Image {
bytes: &'a [u8],
},
Audio {
samples: &'a [f32],
sample_rate: u32,
},
Video {
frames: &'a [VideoFrame<'a>],
},
}Expand description
A borrowed input to embed. The request selects its task independently.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
A text segment. title is a heading or file name, when one is known.
Image
An encoded image file (PNG, JPEG, …).
Audio
Mono PCM samples at the given sample rate.
Video
Decoded frames with their timestamps. Reserved: no shipped embedder accepts video yet.
Fields
§
frames: &'a [VideoFrame<'a>]Implementations§
Trait Implementations§
Source§impl<'a> Clone for ResourceInput<'a>
impl<'a> Clone for ResourceInput<'a>
Source§fn clone(&self) -> ResourceInput<'a>
fn clone(&self) -> ResourceInput<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ResourceInput<'a>
impl<'a> RefUnwindSafe for ResourceInput<'a>
impl<'a> Send for ResourceInput<'a>
impl<'a> Sync for ResourceInput<'a>
impl<'a> Unpin for ResourceInput<'a>
impl<'a> UnsafeUnpin for ResourceInput<'a>
impl<'a> UnwindSafe for ResourceInput<'a>
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