pub struct WechatContext { /* private fields */ }Expand description
Context holding shared resources for WeChat API implementations.
Contains references to the HTTP client and token manager that API implementations need to make requests.
Implementations§
Source§impl WechatContext
impl WechatContext
Sourcepub fn new(client: Arc<WechatClient>, token_manager: Arc<TokenManager>) -> Self
pub fn new(client: Arc<WechatClient>, token_manager: Arc<TokenManager>) -> Self
Create a new WechatContext
Sourcepub fn client(&self) -> &WechatClient
pub fn client(&self) -> &WechatClient
Get a reference to the WeChat HTTP client.
Sourcepub fn token_manager(&self) -> &TokenManager
pub fn token_manager(&self) -> &TokenManager
Get a reference to the token manager.
Trait Implementations§
Source§impl Clone for WechatContext
impl Clone for WechatContext
Source§fn clone(&self) -> WechatContext
fn clone(&self) -> WechatContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WechatContext
impl !RefUnwindSafe for WechatContext
impl Send for WechatContext
impl Sync for WechatContext
impl Unpin for WechatContext
impl UnsafeUnpin for WechatContext
impl !UnwindSafe for WechatContext
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