Struct stable_diffusion_api::Txt2Img
source · pub struct Txt2Img { /* private fields */ }
Expand description
A client for sending image requests to a specified endpoint.
Implementations§
source§impl Txt2Img
impl Txt2Img
sourcepub fn new(client: Client, endpoint: String) -> Result<Self, Txt2ImgError>
pub fn new(client: Client, endpoint: String) -> Result<Self, Txt2ImgError>
Constructs a new Txt2Img 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 Txt2Img 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: &Txt2ImgRequest,
) -> Result<ImgResponse<Txt2ImgRequest>, Txt2ImgError>
pub async fn send( &self, request: &Txt2ImgRequest, ) -> Result<ImgResponse<Txt2ImgRequest>, Txt2ImgError>
Auto Trait Implementations§
impl Freeze for Txt2Img
impl !RefUnwindSafe for Txt2Img
impl Send for Txt2Img
impl Sync for Txt2Img
impl Unpin for Txt2Img
impl !UnwindSafe for Txt2Img
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