Struct bing_client::client::BingClient
source · pub struct BingClient {
pub reqwest_client: Client,
pub cookie_str: String,
pub client_id: String,
pub chats: Vec<Chat>,
}
Fields§
§reqwest_client: Client
§client_id: String
§chats: Vec<Chat>
Implementations§
source§impl BingClient
impl BingClient
pub async fn build(cookie: &Cookie) -> Result<BingClient, Error>
pub async fn build_with_chats(cookie: &Cookie) -> Result<BingClient, Error>
pub async fn update_client_id(&mut self) -> Result<(), Error>
pub async fn update_chats_client_id(&mut self) -> Result<(), Error>
pub async fn get_chat_list(&self) -> Result<Vec<Chat>, Error>
pub async fn create_chat(&self) -> Result<Chat, Error>
pub async fn delete_chat(&self, chat: &Chat) -> Result<(), Error>
pub async fn delete_chats<'a>(&self, chats: TodelChats<'a>) -> Result<(), Error>
pub async fn rename_chat( &self, chat: &Chat, new_name: String ) -> Result<(), Error>
pub async fn update_conversation( &self, chat: &Chat, new_message: Value ) -> Result<(), Error>
pub async fn get_chat_messages( &self, chat: &Chat ) -> Result<Vec<EasyMsg>, Error>
pub async fn draw_image(&self, prompt: &str) -> Result<Vec<Image>, Error>
pub async fn ask_stream_plain<'a>( &'a self, chat: &'a Chat, user_input: UserInput ) -> Result<(Gen<String, (), impl Future<Output = ()> + 'a>, impl Fn()), Error>
pub async fn ask_stream<'a>( &'a self, chat: &'a Chat, user_input: UserInput ) -> Result<(Gen<BotResp, (), impl Future<Output = ()> + 'a>, impl Fn()), Error>
Trait Implementations§
source§impl Debug for BingClient
impl Debug for BingClient
source§impl<'de> Deserialize<'de> for BingClient
impl<'de> Deserialize<'de> for BingClient
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BingClient
impl !RefUnwindSafe for BingClient
impl Send for BingClient
impl Sync for BingClient
impl Unpin for BingClient
impl !UnwindSafe for BingClient
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more