pub struct Agent {
pub config: AgentConfig,
pub cookies: Vec<Cookie>,
}Fields§
§config: AgentConfigImplementations§
Source§impl Agent
impl Agent
pub fn new(config: AgentConfig, cookies: Vec<Cookie>) -> Self
pub fn command(&self) -> &str
pub fn args(&self) -> &[String]
Sourcepub async fn check_limit(&self) -> Result<AgentLimit, Box<dyn Error>>
pub async fn check_limit(&self) -> Result<AgentLimit, Box<dyn Error>>
§Errors
Returns an error if fetching usage from the provider API fails or the domain is unknown.
Sourcepub async fn fetch_status(&self) -> Result<AgentStatus, Box<dyn Error>>
pub async fn fetch_status(&self) -> Result<AgentStatus, Box<dyn Error>>
§Errors
Returns an error if fetching usage from the provider API fails or the domain is unknown.
Sourcepub fn execute(
&self,
resolved_args: &[String],
extra_args: &[String],
) -> Result<ExitStatus>
pub fn execute( &self, resolved_args: &[String], extra_args: &[String], ) -> Result<ExitStatus>
§Errors
Returns an error if spawning or waiting on the child process fails.
pub fn has_model(&self, model_key: &str) -> bool
pub fn resolved_args(&self, model: Option<&str>) -> Vec<String>
pub fn mapped_args(&self, args: &[String]) -> Vec<String>
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
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