pub struct CardReplier { /* private fields */ }Expand description
卡片回复器(使用 Arc 共享所有权,避免生命周期问题)
Implementations§
Source§impl CardReplier
impl CardReplier
Sourcepub fn new(
http_client: HttpClient,
token_manager: Arc<TokenManager>,
client_id: String,
incoming_message: ChatbotMessage,
) -> Self
pub fn new( http_client: HttpClient, token_manager: Arc<TokenManager>, client_id: String, incoming_message: ChatbotMessage, ) -> Self
创建新的卡片回复器
Sourcepub fn gen_card_id(msg: &ChatbotMessage) -> String
pub fn gen_card_id(msg: &ChatbotMessage) -> String
生成卡片 ID (SHA256)
Sourcepub async fn create_and_send_card(
&self,
card_template_id: &str,
card_data: &Value,
callback_type: &str,
callback_route_key: &str,
at_sender: bool,
at_all: bool,
recipients: Option<&[String]>,
support_forward: bool,
) -> Result<String>
pub async fn create_and_send_card( &self, card_template_id: &str, card_data: &Value, callback_type: &str, callback_route_key: &str, at_sender: bool, at_all: bool, recipients: Option<&[String]>, support_forward: bool, ) -> Result<String>
创建并发送卡片(两步:创建 + 投放)
Trait Implementations§
Source§impl Clone for CardReplier
impl Clone for CardReplier
Source§fn clone(&self) -> CardReplier
fn clone(&self) -> CardReplier
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 CardReplier
impl !RefUnwindSafe for CardReplier
impl Send for CardReplier
impl Sync for CardReplier
impl Unpin for CardReplier
impl UnsafeUnpin for CardReplier
impl !UnwindSafe for CardReplier
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