pub struct ClientBuilder { /* private fields */ }Expand description
A builder for creating a ComfyUIClient instance.
This builder helps initialize the client with the provided base URL and sets up a websocket connection to stream events.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(base_url: impl IntoUrl) -> ClientResult<Self>
pub fn new(base_url: impl IntoUrl) -> ClientResult<Self>
Creates a new ClientBuilder instance.
§Parameters
base_url: The base URL of the ComfyUI service.
§Returns
A new instance of ClientBuilder wrapped in a ClientResult, or an
error if the URL is invalid.
Sourcepub async fn build(self) -> ClientResult<(ComfyUIClient, EventStream)>
pub async fn build(self) -> ClientResult<(ComfyUIClient, EventStream)>
Builds the ComfyUIClient along with an associated EventStream.
This method establishes a websocket connection and spawns an asynchronous task to process incoming messages.
§Returns
A tuple containing the ComfyUIClient and EventStream on success,
or an error.
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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