pub enum Role {
System,
User,
Assistant,
Tool,
}Expand description
Conversation role for CONVERSATION blocks.
Maps the four standard chat roles to single-byte wire values.
Unlike Lang, this enum does not have an Other variant —
unrecognized role bytes produce an error, since role semantics
are fundamental to conversation structure.
┌──────┬───────────┐
│ Wire │ Role │
├──────┼───────────┤
│ 0x01 │ System │
│ 0x02 │ User │
│ 0x03 │ Assistant │
│ 0x04 │ Tool │
└──────┴───────────┘Variants§
Implementations§
Trait Implementations§
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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