pub struct TfDecideClient { /* private fields */ }Expand description
Shared mini-client for /v1/decide.
Implementations§
Source§impl TfDecideClient
impl TfDecideClient
Sourcepub fn new(
daemon_url: impl Into<String>,
admin_token: impl Into<String>,
) -> Self
pub fn new( daemon_url: impl Into<String>, admin_token: impl Into<String>, ) -> Self
Build a new client. daemon_url must NOT end with a trailing slash.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Override the per-request timeout.
Sourcepub fn daemon_url(&self) -> &str
pub fn daemon_url(&self) -> &str
The daemon URL this client is bound to (sans trailing slash).
Sourcepub async fn decide(
&self,
req: &DecideRequest,
) -> Result<DecideResponse, ClientError>
pub async fn decide( &self, req: &DecideRequest, ) -> Result<DecideResponse, ClientError>
Call POST {daemon}/v1/decide and decode the response.
Trait Implementations§
Source§impl Clone for TfDecideClient
impl Clone for TfDecideClient
Source§fn clone(&self) -> TfDecideClient
fn clone(&self) -> TfDecideClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TfDecideClient
impl RefUnwindSafe for TfDecideClient
impl Send for TfDecideClient
impl Sync for TfDecideClient
impl Unpin for TfDecideClient
impl UnsafeUnpin for TfDecideClient
impl UnwindSafe for TfDecideClient
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