pub struct Session {
pub version: u32,
pub messages: Vec<ConversationMessage>,
}Fields§
§version: u32§messages: Vec<ConversationMessage>Implementations§
Source§impl Session
impl Session
pub fn new() -> Self
pub fn save_to_path(&self, path: impl AsRef<Path>) -> Result<(), SessionError>
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, SessionError>
pub fn to_json(&self) -> JsonValue
pub fn from_json(value: &JsonValue) -> Result<Self, SessionError>
Trait Implementations§
impl Eq for Session
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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