pub struct Client {
pub server_url: String,
/* private fields */
}Expand description
A client of one server.
Fields§
§server_url: StringThe normalized server URL.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(server_url: &str, api_key: Option<String>) -> Result<Client, String>
pub fn new(server_url: &str, api_key: Option<String>) -> Result<Client, String>
A client of server_url, sending api_key when there is one.
Sourcepub async fn list(
&self,
reload: bool,
cancel: &CancellationToken,
) -> Result<Vec<ModelInfo>, String>
pub async fn list( &self, reload: bool, cancel: &CancellationToken, ) -> Result<Vec<ModelInfo>, String>
The server’s models. reload rescans its model directories.
Sourcepub async fn props(
&self,
model: Option<&str>,
cancel: &CancellationToken,
) -> Result<Props, String>
pub async fn props( &self, model: Option<&str>, cancel: &CancellationToken, ) -> Result<Props, String>
/props, for model without loading it, or for the server.
Sourcepub async fn load(
&self,
model: &str,
cancel: &CancellationToken,
) -> Result<(), String>
pub async fn load( &self, model: &str, cancel: &CancellationToken, ) -> Result<(), String>
Asks the router to load model.
Sourcepub async fn unload(
&self,
model: &str,
cancel: &CancellationToken,
) -> Result<(), String>
pub async fn unload( &self, model: &str, cancel: &CancellationToken, ) -> Result<(), String>
Asks the router to unload model, or to stop loading or downloading it.
Sourcepub async fn unload_and_wait(
&self,
model: &str,
cancel: &CancellationToken,
) -> Result<(), String>
pub async fn unload_and_wait( &self, model: &str, cancel: &CancellationToken, ) -> Result<(), String>
Unloads model and waits until it is unloaded.
Sourcepub async fn download(
&self,
model: &str,
cancel: &CancellationToken,
) -> Result<(), String>
pub async fn download( &self, model: &str, cancel: &CancellationToken, ) -> Result<(), String>
Asks the router to download model, a Hugging Face repo[:quant].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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