pub struct WeixinClient { /* private fields */ }Expand description
The main SDK client.
Implementations§
Source§impl WeixinClient
impl WeixinClient
Sourcepub fn builder(config: WeixinConfig) -> WeixinClientBuilder
pub fn builder(config: WeixinConfig) -> WeixinClientBuilder
Create a new builder.
Sourcepub async fn start(&self, initial_sync_buf: Option<String>) -> Result<()>
pub async fn start(&self, initial_sync_buf: Option<String>) -> Result<()>
Start the long-poll monitor loop. Blocks until shutdown.
initial_sync_buf should be loaded from your persistence layer (or None for fresh start).
Sourcepub async fn send_text(
&self,
to: &str,
text: &str,
context_token: Option<&str>,
) -> Result<SendResult>
pub async fn send_text( &self, to: &str, text: &str, context_token: Option<&str>, ) -> Result<SendResult>
Send a text message to a user.
Sourcepub async fn send_media(
&self,
to: &str,
file_path: &Path,
context_token: Option<&str>,
) -> Result<SendResult>
pub async fn send_media( &self, to: &str, file_path: &Path, context_token: Option<&str>, ) -> Result<SendResult>
Send a media file to a user.
Sourcepub fn qr_login(&self) -> QrLoginApi<'_>
pub fn qr_login(&self) -> QrLoginApi<'_>
Get a QR login API handle.
Sourcepub fn context_tokens(&self) -> &ContextTokenStore
pub fn context_tokens(&self) -> &ContextTokenStore
Access the context token store (for export/import).
Auto Trait Implementations§
impl Freeze for WeixinClient
impl !RefUnwindSafe for WeixinClient
impl Send for WeixinClient
impl Sync for WeixinClient
impl Unpin for WeixinClient
impl UnsafeUnpin for WeixinClient
impl !UnwindSafe for WeixinClient
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