Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }

Implementations§

Source§

impl Session

Source

pub fn set_activity_hook( &self, hook: Box<dyn Fn(Option<&str>, SurfaceState) + Send + Sync>, )

Source

pub fn start(runner: Box<dyn PromptRunner>, model: String) -> Session

Source

pub fn start_with<F>(model: String, build_runner: F) -> Session

Source

pub fn start_with_log<F>( model: String, log_path: Option<PathBuf>, build_runner: F, ) -> Result<Session, String>

Source

pub fn start_with_log_io<F>( model: String, log_path: Option<PathBuf>, err: &mut dyn Write, build_runner: F, ) -> Result<Session, String>

Source

pub fn try_start_with_log_io<F>( model: String, log_path: Option<PathBuf>, err: &mut dyn Write, build_runner: F, ) -> Result<Session, String>

Source

pub fn try_start_with_log_and_resume_io<F>( model: String, log_path: Option<PathBuf>, resume_memory: ResumeMemoryState, err: &mut dyn Write, build_runner: F, ) -> Result<Session, String>

Source

pub fn approver(&self) -> Arc<SurfaceApprover> ⓘ

Source

pub fn has_pending_publish(&self, request: &str) -> bool

Source

pub fn answer_approval( &self, id: &str, answer: ApprovalAnswer, ) -> Result<u64, AnswerError>

Source

pub fn stop_run(&self)

Source

pub fn mark_seen(&self)

Source

pub fn set_attachments_root(&self, dir: PathBuf)

Source

pub fn attachments_root(&self) -> Option<PathBuf>

Source

pub fn submit( &self, text: &str, attachments: Vec<Attachment>, ) -> Result<u64, String>

Source

pub fn submit_with_attachments( &self, text: &str, reports: Vec<Attachment>, file_attachments: Vec<QueuedAttachment>, pastes: Vec<Paste>, ) -> Result<u64, String>

Source

pub fn submit_peer( &self, from_name: &str, from_repository: &str, text: &str, ) -> Result<PeerDelivery, String>

Source

pub fn entries_after(&self, after: u64, wait: Duration) -> Vec<Entry>

Source

pub fn info(&self) -> SessionInfo

Source

pub fn set_model(&self, model: &str) -> Result<(), String>

Source

pub fn set_effort(&self, effort: Option<&str>) -> Result<(), String>

Source

pub fn record_decision( &self, run: &str, action: &str, note: Option<&str>, conversation_message: Option<&str>, ) -> Result<u64, String>

Source

pub fn queue_for_request( &self, request_id: &str, text: &str, ) -> Result<u64, String>

Source

pub fn record_error(&self, message: &str) -> u64

Trait Implementations§

Source§

impl Clone for Session

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Forget for Session

§

impl Freeze for Session
where *const ArcInner<SessionGuard> is !null: Freeze, PhantomData<ArcInner<SessionGuard>>: Freeze,

§

impl Move for Session

§

impl RefUnwindSafe for Session

§

impl Send for Session
where Arc<SessionGuard>: Send,

§

impl Sync for Session
where Arc<SessionGuard>: Sync,

§

impl Unpin for Session
where Arc<SessionGuard>: Unpin,

§

impl UnsafeUnpin for Session
where *const ArcInner<SessionGuard> is !null: UnsafeUnpin, PhantomData<ArcInner<SessionGuard>>: UnsafeUnpin,

§

impl UnwindSafe for Session
where Arc<SessionGuard>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.