pub enum Contents<'a> {
Text(&'a str),
Structured(&'a [Content]),
}Expand description
Input contents, accepting either a text string or structured Content objects.
Matches the Python SDK’s flexible content input where count_tokens and
compute_tokens accept both plain strings and structured Content objects.
§From implementations
&str→ wraps as a single user Content with one text Part&[Content]→ uses the Content slice directly&Vec<Content>→ delegates to the slice implementation
Variants§
Text(&'a str)
Plain text input (will be wrapped as a user Content).
Structured(&'a [Content])
Structured Content objects.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Contents<'a>
impl<'a> RefUnwindSafe for Contents<'a>
impl<'a> Send for Contents<'a>
impl<'a> Sync for Contents<'a>
impl<'a> Unpin for Contents<'a>
impl<'a> UnwindSafe for Contents<'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