pub struct Client { /* private fields */ }Expand description
V2 client for OpenCode’s /api/* HTTP surface.
Implementations§
Source§impl Client
impl Client
pub fn health(&self) -> HealthApi<'_>
pub fn location(&self) -> LocationApi<'_>
pub fn agent(&self) -> AgentApi<'_>
pub fn command(&self) -> CommandApi<'_>
pub fn skill(&self) -> SkillApi<'_>
pub fn reference(&self) -> ReferenceApi<'_>
pub fn integration(&self) -> IntegrationApi<'_>
pub fn credential(&self) -> CredentialApi<'_>
Source§impl Client
impl Client
pub fn model(&self) -> ModelApi<'_>
pub fn provider(&self) -> ProviderApi<'_>
pub fn fs(&self) -> FsApi<'_>
pub fn permission(&self) -> PermissionApi<'_>
pub fn question(&self) -> QuestionApi<'_>
Source§impl Client
impl Client
pub fn builder() -> ClientBuilder
pub fn session(&self) -> SessionApi<'_>
pub fn events(&self) -> EventsApi<'_>
Sourcepub async fn serve_dialect(&self) -> Result<ServeDialect, Error>
pub async fn serve_dialect(&self) -> Result<ServeDialect, Error>
Detect which /api/* dialect the connected OpenCode server speaks.
Probes GET api/info: OpenCode 2.x answers with a JSON ServerInfo
body while OpenCode 1.x serves the HTML app shell there, so a JSON
response containing version identifies the native 2.x contract.
The result is cached on this client.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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