Struct ModelRouter
pub struct ModelRouter { /* private fields */ }Expand description
Client router for models.
Implementations§
§impl ModelRouter
impl ModelRouter
pub fn new(uri: &str, prefix: &str, timeout_s: f64, http: Client) -> Self
pub fn new(uri: &str, prefix: &str, timeout_s: f64, http: Client) -> Self
Creates a new model router.
pub fn post(&self, name: &str, source: &ModelSource) -> Result<String>
pub fn post(&self, name: &str, source: &ModelSource) -> Result<String>
Posts a model from a local file or a remote URL, saving it as name.
pub fn put(&self, source: &ModelSource, name: Option<&str>) -> Result<String>
pub fn put(&self, source: &ModelSource, name: Option<&str>) -> Result<String>
Puts (overwrites) a model from a local file or a remote URL.
For ModelSource::Path the filename is derived from the path. For
ModelSource::Url a name is required.
Trait Implementations§
§impl Clone for ModelRouter
impl Clone for ModelRouter
§fn clone(&self) -> ModelRouter
fn clone(&self) -> ModelRouter
Returns a duplicate of the value. Read more
1.0.0 · 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 ModelRouter
impl !RefUnwindSafe for ModelRouter
impl Send for ModelRouter
impl Sync for ModelRouter
impl Unpin for ModelRouter
impl !UnwindSafe for ModelRouter
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