Struct stable_diffusion_api::Img2Img
source · 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::Client
used to send requests.endpoint
- AString
representation 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