Struct comfyui_api::api::Api
source · pub struct Api { /* private fields */ }Expand description
Struct representing a connection to a ComfyUI API.
Implementations§
source§impl Api
impl Api
sourcepub fn new_with_url<S>(url: S) -> Result<Self, ApiError>
pub fn new_with_url<S>(url: S) -> Result<Self, ApiError>
sourcepub fn new_with_client_and_url<S>(
client: Client,
url: S,
) -> Result<Self, ApiError>
pub fn new_with_client_and_url<S>( client: Client, url: S, ) -> Result<Self, ApiError>
sourcepub fn prompt(&self) -> Result<PromptApi, ApiError>
pub fn prompt(&self) -> Result<PromptApi, ApiError>
Returns a new instance of PromptApi with the API’s cloned
reqwest::Client and the URL for the prompt endpoint.
§Errors
If the URL fails to parse, an error will be returned.
sourcepub fn history(&self) -> Result<HistoryApi, ApiError>
pub fn history(&self) -> Result<HistoryApi, ApiError>
Returns a new instance of HistoryApi with the API’s cloned
reqwest::Client and the URL for the history endpoint.
§Errors
If the URL fails to parse, an error will be returned.
sourcepub fn upload(&self) -> Result<UploadApi, ApiError>
pub fn upload(&self) -> Result<UploadApi, ApiError>
Returns a new instance of UploadApi with the API’s cloned
reqwest::Client and the URL for the view endpoint.
§Errors
If the URL fails to parse, an error will be returned.
sourcepub fn view(&self) -> Result<ViewApi, ApiError>
pub fn view(&self) -> Result<ViewApi, ApiError>
Returns a new instance of ViewApi with the API’s cloned
reqwest::Client and the URL for the view endpoint.
§Errors
If the URL fails to parse, an error will be returned.
sourcepub fn websocket(&self) -> Result<WebsocketApi, ApiError>
pub fn websocket(&self) -> Result<WebsocketApi, ApiError>
Returns a new instance of WebsocketApi with the API’s cloned
reqwest::Client and the URL for the ws endpoint.
§Errors
- If the URL fails to parse, an error will be returned.
- On failure to set the
ws://scheme on the URL, an error will be returned.
sourcepub fn websocket_with_client(
&self,
client_id: Uuid,
) -> Result<WebsocketApi, ApiError>
pub fn websocket_with_client( &self, client_id: Uuid, ) -> Result<WebsocketApi, ApiError>
Returns a new instance of WebsocketApi with the API’s cloned
reqwest::Client and the URL for the ws endpoint and the specified
client id.
§Arguments
client_id- Auuid::Uuidrepresenting the client id to use for the request.
§Errors
- If the URL fails to parse, an error will be returned.
- On failure to set the
ws://scheme on the URL, an error will be returned.