pub struct TextPart<'id> { /* private fields */ }Expand description
An open text part of one reply. Only opening the part gives one, so a fragment cannot precede its part’s start:
ⓘ
use rig_core::operation::{Completion, TextPart};
use rig_core::wire::Out;
fn early(out: &mut Out<'_, Completion>) {
out.push_text(&TextPart::default(), "before the start");
}Nor can one be built from its fields to write into a part:
ⓘ
use rig_core::operation::{Completion, TextPart};
use rig_core::wire::Out;
fn forge<'id>(out: &mut Out<'id, Completion>) {
let part = TextPart { slot: 0, brand: std::marker::PhantomData };
out.push_text(&part, "into a part this code never opened");
}Trait Implementations§
Auto Trait Implementations§
impl<'id> Freeze for TextPart<'id>
impl<'id> RefUnwindSafe for TextPart<'id>
impl<'id> Send for TextPart<'id>
impl<'id> Sync for TextPart<'id>
impl<'id> Unpin for TextPart<'id>
impl<'id> UnsafeUnpin for TextPart<'id>
impl<'id> UnwindSafe for TextPart<'id>
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