pub struct SessionResource<'a> { /* private fields */ }Expand description
Provides access to the Session-related API endpoints.
Implementations§
Source§impl<'a> SessionResource<'a>
impl<'a> SessionResource<'a>
Sourcepub async fn create(
&self,
options: Option<&RequestOptions>,
) -> Result<Session, OpencodeError>
pub async fn create( &self, options: Option<&RequestOptions>, ) -> Result<Session, OpencodeError>
Create a new session (POST /session).
Sourcepub async fn list(
&self,
options: Option<&RequestOptions>,
) -> Result<SessionListResponse, OpencodeError>
pub async fn list( &self, options: Option<&RequestOptions>, ) -> Result<SessionListResponse, OpencodeError>
List all sessions (GET /session).
Sourcepub async fn delete(
&self,
id: &str,
options: Option<&RequestOptions>,
) -> Result<SessionDeleteResponse, OpencodeError>
pub async fn delete( &self, id: &str, options: Option<&RequestOptions>, ) -> Result<SessionDeleteResponse, OpencodeError>
Delete a session (DELETE /session/{id}).
Sourcepub async fn abort(
&self,
id: &str,
options: Option<&RequestOptions>,
) -> Result<SessionAbortResponse, OpencodeError>
pub async fn abort( &self, id: &str, options: Option<&RequestOptions>, ) -> Result<SessionAbortResponse, OpencodeError>
Abort a running session (POST /session/{id}/abort).
Sourcepub async fn chat(
&self,
id: &str,
params: &SessionChatParams,
options: Option<&RequestOptions>,
) -> Result<SessionMessagesResponseItem, OpencodeError>
pub async fn chat( &self, id: &str, params: &SessionChatParams, options: Option<&RequestOptions>, ) -> Result<SessionMessagesResponseItem, OpencodeError>
Send a chat message (POST /session/{id}/message).
Sourcepub async fn init(
&self,
id: &str,
params: &SessionInitParams,
options: Option<&RequestOptions>,
) -> Result<SessionInitResponse, OpencodeError>
pub async fn init( &self, id: &str, params: &SessionInitParams, options: Option<&RequestOptions>, ) -> Result<SessionInitResponse, OpencodeError>
Initialise a session (POST /session/{id}/init).
Sourcepub async fn messages(
&self,
id: &str,
options: Option<&RequestOptions>,
) -> Result<SessionMessagesResponse, OpencodeError>
pub async fn messages( &self, id: &str, options: Option<&RequestOptions>, ) -> Result<SessionMessagesResponse, OpencodeError>
List messages in a session (GET /session/{id}/message).
Sourcepub async fn revert(
&self,
id: &str,
params: &SessionRevertParams,
options: Option<&RequestOptions>,
) -> Result<Session, OpencodeError>
pub async fn revert( &self, id: &str, params: &SessionRevertParams, options: Option<&RequestOptions>, ) -> Result<Session, OpencodeError>
Revert a session to a previous state (POST /session/{id}/revert).
Share a session (POST /session/{id}/share).
Sourcepub async fn summarize(
&self,
id: &str,
params: &SessionSummarizeParams,
options: Option<&RequestOptions>,
) -> Result<SessionSummarizeResponse, OpencodeError>
pub async fn summarize( &self, id: &str, params: &SessionSummarizeParams, options: Option<&RequestOptions>, ) -> Result<SessionSummarizeResponse, OpencodeError>
Summarise a session (POST /session/{id}/summarize).
Sourcepub async fn unrevert(
&self,
id: &str,
options: Option<&RequestOptions>,
) -> Result<Session, OpencodeError>
pub async fn unrevert( &self, id: &str, options: Option<&RequestOptions>, ) -> Result<Session, OpencodeError>
Unrevert a session (POST /session/{id}/unrevert).
Unshare a session (DELETE /session/{id}/share).
Auto Trait Implementations§
impl<'a> Freeze for SessionResource<'a>
impl<'a> !RefUnwindSafe for SessionResource<'a>
impl<'a> Send for SessionResource<'a>
impl<'a> Sync for SessionResource<'a>
impl<'a> Unpin for SessionResource<'a>
impl<'a> !UnwindSafe for SessionResource<'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