Struct wechaty_puppet::puppet::Puppet[][src]

pub struct Puppet<T> where
    T: 'static + PuppetImpl + Clone + Unpin + Send + Sync
{ /* fields omitted */ }

Implementations

impl<T> Puppet<T> where
    T: 'static + PuppetImpl + Clone + Unpin + Send + Sync
[src]

pub fn new(puppet_impl: T) -> Self[src]

pub fn self_addr(&self) -> Recipient<PuppetEvent>[src]

pub fn get_subscribe_addr(&self) -> Recipient<Subscribe>[src]

pub fn get_unsubscribe_addr(&self) -> Recipient<UnSubscribe>[src]

pub fn self_id(self) -> Option<String>[src]

pub fn log_on_off(self) -> bool[src]

pub async fn contact_payload(
    &self,
    contact_id: String
) -> Result<ContactPayload, PuppetError>
[src]

Load a contact by id.

pub async fn contact_search_by_string(
    &mut self,
    query_str: String,
    search_id_list: Option<Vec<String>>
) -> Result<Vec<String>, PuppetError>
[src]

Search contacts by string.

Return all contacts that has an alias or name that matches the query string.

Search contacts by query.

pub async fn message_payload(
    &self,
    message_id: String
) -> Result<MessagePayload, PuppetError>
[src]

Load a message by id.

pub fn message_list(&self) -> Vec<String>[src]

Get all cached messages.

pub async fn message_forward(
    &mut self,
    conversation_id: String,
    message_id: String
) -> Result<Option<String>, PuppetError>
[src]

Search friendship.

First search by phone, then search by weixin.

pub async fn friendship_payload(
    &self,
    friendship_id: String
) -> Result<FriendshipPayload, PuppetError>
[src]

Load a friendship by id.

pub async fn friendship_payload_set(
    &mut self,
    friendship_id: String,
    new_payload: FriendshipPayload
) -> Result<(), PuppetError>
[src]

Friendship payload setter.

pub async fn room_invitation_payload(
    &self,
    room_invitation_id: String
) -> Result<RoomInvitationPayload, PuppetError>
[src]

Load a room invitation by id.

pub async fn room_invitation_payload_set(
    &mut self,
    room_invitation_id: String,
    new_payload: RoomInvitationPayload
) -> Result<(), PuppetError>
[src]

Room invitation payload setter.

pub async fn room_payload(
    &self,
    room_id: String
) -> Result<RoomPayload, PuppetError>
[src]

Load a room by id.

pub async fn room_member_search_by_string(
    &mut self,
    room_id: String,
    query_str: String
) -> Result<Vec<String>, PuppetError>
[src]

Search room members by string.

Search room members.

Currently, searching by contact alias is not supported.

pub async fn room_member_payload(
    &self,
    room_id: String,
    member_id: String
) -> Result<RoomMemberPayload, PuppetError>
[src]

Load a room member by room id and payload id.

pub async fn dirty_payload(
    &mut self,
    payload_type: PayloadType,
    id: String
) -> Result<(), PuppetError>
[src]

Trait Implementations

impl<T: Clone> Clone for Puppet<T> where
    T: 'static + PuppetImpl + Clone + Unpin + Send + Sync
[src]

impl<T> PuppetImpl for Puppet<T> where
    T: 'static + PuppetImpl + Clone + Unpin + Send + Sync
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Puppet<T>

impl<T> Send for Puppet<T>

impl<T> Sync for Puppet<T>

impl<T> Unpin for Puppet<T>

impl<T> !UnwindSafe for Puppet<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.