Struct comfyui_api::api::websocket::WebsocketApi
source · pub struct WebsocketApi { /* private fields */ }
Expand description
Struct representing a connection to the ComfyUI API ws
endpoint.
Implementations§
source§impl WebsocketApi
impl WebsocketApi
sourcepub fn new<S>(endpoint: S) -> Result<Self, WebSocketApiError>
pub fn new<S>(endpoint: S) -> Result<Self, WebSocketApiError>
sourcepub fn new_with_url(endpoint: Url) -> Self
pub fn new_with_url(endpoint: Url) -> Self
sourcepub async fn connect(
&self,
) -> Result<impl FusedStream<Item = Result<PreviewOrUpdate, WebSocketApiError>>, WebSocketApiError>
pub async fn connect( &self, ) -> Result<impl FusedStream<Item = Result<PreviewOrUpdate, WebSocketApiError>>, WebSocketApiError>
Connects to the websocket endpoint and returns a stream of PreviewOrUpdate
values.
§Returns
A Stream
of PreviewOrUpdate
values. These are either Update
values, which contain
progress updates for a task, or Preview
values, which contain a preview image.
sourcepub async fn updates(
&self,
) -> Result<impl FusedStream<Item = Result<Update, WebSocketApiError>>, WebSocketApiError>
pub async fn updates( &self, ) -> Result<impl FusedStream<Item = Result<Update, WebSocketApiError>>, WebSocketApiError>
Connects to the websocket endpoint and returns a stream of Update
values.
§Returns
A Stream
of Update
values. These contain progress updates for a task.
sourcepub async fn previews(
&self,
) -> Result<impl FusedStream<Item = Result<Preview, WebSocketApiError>>, WebSocketApiError>
pub async fn previews( &self, ) -> Result<impl FusedStream<Item = Result<Preview, WebSocketApiError>>, WebSocketApiError>
Connects to the websocket endpoint and returns a stream of Preview
values.
§Returns
A Stream
of Preview
values. These contain preview images.
Trait Implementations§
source§impl Clone for WebsocketApi
impl Clone for WebsocketApi
source§fn clone(&self) -> WebsocketApi
fn clone(&self) -> WebsocketApi
Returns a copy 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 WebsocketApi
impl RefUnwindSafe for WebsocketApi
impl Send for WebsocketApi
impl Sync for WebsocketApi
impl Unpin for WebsocketApi
impl UnwindSafe for WebsocketApi
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