MpSdk

Struct MpSdk 

Source
pub struct MpSdk<T: AccessTokenProvider> { /* private fields */ }
Expand description

公众号接口SDK,由于 Rust Doc 中还无法搜索中文,请直接搜索相关请求 url 中的关键信息,例如 clear_quota为接口限额清零接口。

Implementations§

Source§

impl<T: AccessTokenProvider> MpSdk<T>

Source

pub async fn clear_quota(&self) -> SdkResult<()>

接口限额清零

公众号调用接口并不是无限制的。 每个帐号每月共10次清零操作机会,清零生效一次即用掉一次机会(10次包括了平台上的清零和调用接口API的清零)。

Source

pub fn qrcode(&self) -> QrcodeModule<'_, WxSdk<T>>

Qrcode generator module 生成二维码模块

Source

pub fn shorten(&self) -> ShortenModule<'_, WxSdk<T>>

Short key generator module 短key生成模块

Source

pub fn tags(&self) -> TagsModule<'_, WxSdk<T>>

Tag module 标签模块

Source

pub fn user(&self) -> UserModule<'_, WxSdk<T>>

User module 用户模块

Source

pub fn message(&self) -> MessageModule<'_, WxSdk<T>>

Message send module 消息(发送)相关模块

Source

pub fn menu(&self) -> MenuModule<'_, WxSdk<T>>

Menu module 自定义菜单模块

Source

pub fn template(&self) -> TemplateModule<'_, WxSdk<T>>

Template message module 模板消息模块

Source

pub fn media(&self) -> MediaModule<'_, WxSdk<T>>

Media module (临时)素材文件模块

Source

pub fn material(&self) -> MaterialModule<'_, WxSdk<T>>

Material module (永久)素材模块

Source

pub fn datacube(&self) -> DataCubeModule<'_, WxSdk<T>>

Datacube module 分析中心模块

Source

pub fn customservice(&self) -> CustomServiceModule<'_, WxSdk<T>>

Custom Service module 客服模块

Source

pub fn ticket(&self) -> TicketModule<'_, T>

获取jsapi ticket 或者 wx_card ticket

Source

pub fn sns(&self) -> SnsModule<'_, T>

网页授权模块

Source

pub fn draft(&self) -> DraftModule<'_, T>

草稿箱模块

Source

pub fn freepublish(&self) -> FreePublishModule<'_, T>

草稿箱模块

Source

pub fn parse_received_msg<S: AsRef<str>>( &self, msg: S, url_params: Option<HashMap<String, String>>, ) -> SdkResult<ReceivedEvent>

解析微信推送消息

Source

pub fn reply_to_xml<S: Into<String>>( &self, reply: Reply, from: S, to: S, url_params: Option<HashMap<String, String>>, ) -> SdkResult<String>

得到回复消息 XML

Trait Implementations§

Source§

impl<T: Clone + AccessTokenProvider> Clone for MpSdk<T>

Source§

fn clone(&self) -> MpSdk<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<T> Freeze for MpSdk<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for MpSdk<T>

§

impl<T> Send for MpSdk<T>

§

impl<T> Sync for MpSdk<T>

§

impl<T> Unpin for MpSdk<T>
where T: Unpin,

§

impl<T> !UnwindSafe for MpSdk<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,