pub struct Img2Img { /* private fields */ }Expand description
A client for sending image requests to a specified endpoint.
Implementations§
Source§impl Img2Img
impl Img2Img
Sourcepub fn new(client: Client, endpoint: String) -> Result<Self, Img2ImgError>
pub fn new(client: Client, endpoint: String) -> Result<Self, Img2ImgError>
Constructs a new Img2Img client with a given reqwest::Client and Stable Diffusion API
endpoint String.
§Arguments
client- Areqwest::Clientused to send requests.endpoint- AStringrepresentation of the endpoint url.
§Returns
A Result containing a new Img2Img instance on success, or an error if url parsing failed.
Sourcepub fn new_with_url(client: Client, endpoint: Url) -> Self
pub fn new_with_url(client: Client, endpoint: Url) -> Self
Sourcepub async fn send(
&self,
request: &Img2ImgRequest,
) -> Result<ImgResponse<Img2ImgRequest>, Img2ImgError>
pub async fn send( &self, request: &Img2ImgRequest, ) -> Result<ImgResponse<Img2ImgRequest>, Img2ImgError>
Auto Trait Implementations§
impl Freeze for Img2Img
impl !RefUnwindSafe for Img2Img
impl Send for Img2Img
impl Sync for Img2Img
impl Unpin for Img2Img
impl !UnwindSafe for Img2Img
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