pub struct HttpSystem1 { /* private fields */ }Expand description
Posts System1Request values to a remote System 1 endpoint.
Implementations§
Source§impl HttpSystem1
impl HttpSystem1
Sourcepub fn new(endpoint: impl Into<String>) -> Self
pub fn new(endpoint: impl Into<String>) -> Self
endpoint may be a base URL or a full /v1/systemone or /v1/decide URL.
pub fn with_client(self, client: Client) -> Self
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Pin a checkpoint such as typed-decisions. Unset lets the server route.
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn endpoint(&self) -> &str
Sourcepub fn request_json(&self, request: &System1Request) -> Value
pub fn request_json(&self, request: &System1Request) -> Value
JSON body this client will POST. Useful when a host wants to log the forward pass.
Trait Implementations§
Source§impl Clone for HttpSystem1
impl Clone for HttpSystem1
Source§impl Debug for HttpSystem1
impl Debug for HttpSystem1
Source§impl System1Decider for HttpSystem1
impl System1Decider for HttpSystem1
fn decider_id(&self) -> &str
fn predict<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 System1Request,
) -> Pin<Box<dyn Future<Output = Result<System1Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for HttpSystem1
impl !UnwindSafe for HttpSystem1
impl Freeze for HttpSystem1
impl Send for HttpSystem1
impl Sync for HttpSystem1
impl Unpin for HttpSystem1
impl UnsafeUnpin for HttpSystem1
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