pub struct Client { /* private fields */ }Available on crate feature
blocking only.Expand description
Blocking TypeSafe client. Cheap to clone; clones share the runtime and the connection pool.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(inner: Client) -> Result<Self>
pub fn new(inner: Client) -> Result<Self>
Wrap an async client configured via crate::Client::builder (or build one with
ClientBuilder::build_blocking).
§Errors
Error::Config, with the std::io::Error as its source(), if the runtime cannot be
started.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
A client configured entirely from the environment.
§Errors
Error::Config as for crate::Client::from_env, or if the runtime cannot be started.
Sourcepub fn default_model(&self) -> &str
pub fn default_model(&self) -> &str
The default model.
Sourcepub fn models(&self) -> Models<'_>
pub fn models(&self) -> Models<'_>
The Models resource; see crate::Client::models.
Sourcepub fn system_one<S: Serialize>(
&self,
state: S,
questions: impl Into<Questions>,
) -> SystemOneRequest<'_>
pub fn system_one<S: Serialize>( &self, state: S, questions: impl Into<Questions>, ) -> SystemOneRequest<'_>
Sourcepub fn ask<R: Rubric>(&self, state: impl Serialize) -> AskRequest<'_, R>
pub fn ask<R: Rubric>(&self, state: impl Serialize) -> AskRequest<'_, R>
See crate::Client::ask.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze 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