pub struct VeilClientBuilder { /* private fields */ }Expand description
Builder for VeilClient.
use veil_sdk::VeilClient;
use std::time::Duration;
let client = VeilClient::builder()
.base_url("http://localhost:8080")
.timeout(Duration::from_secs(600))
.poll_interval(Duration::from_secs(3))
.build()
.unwrap();Implementations§
Source§impl VeilClientBuilder
impl VeilClientBuilder
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Base URL of the Veil gateway, e.g. "https://api.mugen.network".
Trailing slashes are stripped automatically.
Sourcepub fn timeout(self, d: Duration) -> Self
pub fn timeout(self, d: Duration) -> Self
Maximum wall-clock time to wait for a job to reach a terminal state.
Applies to verify_inference. Defaults to 600 seconds.
Sourcepub fn poll_interval(self, d: Duration) -> Self
pub fn poll_interval(self, d: Duration) -> Self
How often to poll GET /v1/jobs/{id} while waiting.
Defaults to 3 seconds.
Sourcepub fn build(self) -> Result<VeilClient>
pub fn build(self) -> Result<VeilClient>
Consume the builder and construct a VeilClient.
§Errors
Returns VeilError::InvalidUrl if the base URL cannot be parsed by
reqwest.
Trait Implementations§
Source§impl Debug for VeilClientBuilder
impl Debug for VeilClientBuilder
Auto Trait Implementations§
impl Freeze for VeilClientBuilder
impl RefUnwindSafe for VeilClientBuilder
impl Send for VeilClientBuilder
impl Sync for VeilClientBuilder
impl Unpin for VeilClientBuilder
impl UnsafeUnpin for VeilClientBuilder
impl UnwindSafe for VeilClientBuilder
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