pub struct Rustbox { /* private fields */ }Implementations§
Source§impl Rustbox
impl Rustbox
Sourcepub fn new(api_key: &str) -> Result<Self, RustboxError>
pub fn new(api_key: &str) -> Result<Self, RustboxError>
Construct a Rustbox client. api_key is required (must be non-empty).
Base URL defaults to DEFAULT_BASE_URL; override with with_base_url.
Sourcepub fn with_base_url(self, base_url: &str) -> Result<Self, RustboxError>
pub fn with_base_url(self, base_url: &str) -> Result<Self, RustboxError>
Override the API base URL. Use for staging. Trailing slashes are trimmed.
Sourcepub fn with_timeout(self, timeout: Duration) -> Result<Self, RustboxError>
pub fn with_timeout(self, timeout: Duration) -> Result<Self, RustboxError>
Override the per-request timeout. Set Duration::ZERO to disable.
Sourcepub fn with_max_retries(self, n: u32) -> Self
pub fn with_max_retries(self, n: u32) -> Self
Override the retry budget on transient (5xx, network) failures.
pub fn base_url(&self) -> &str
pub async fn submit( &self, req: &SubmitRequest, wait: bool, opts: SubmitOptions, ) -> Result<Value, RustboxError>
pub async fn get_result(&self, id: &str) -> Result<Value, RustboxError>
pub async fn get_languages(&self) -> Result<Vec<String>, RustboxError>
pub async fn get_health(&self) -> Result<Value, RustboxError>
pub async fn get_ready(&self) -> Result<Value, RustboxError>
Sourcepub async fn run(&self, req: &SubmitRequest) -> Result<Value, RustboxError>
pub async fn run(&self, req: &SubmitRequest) -> Result<Value, RustboxError>
Submit + wait (sync) + auto-poll fallback. Auto-generates an Idempotency-Key so the underlying POST is safe to retry.
Auto Trait Implementations§
impl Freeze for Rustbox
impl !RefUnwindSafe for Rustbox
impl Send for Rustbox
impl Sync for Rustbox
impl Unpin for Rustbox
impl UnsafeUnpin for Rustbox
impl !UnwindSafe for Rustbox
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