chore: bump tauri-plugin-mihomo to 0.1.8

This commit is contained in:
Tunglies
2026-05-13 02:18:29 +08:00
parent e538fa0573
commit d79ad8976a
5 changed files with 22 additions and 69 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ use anyhow::Result;
use serde::Deserialize;
use serde_json::Value;
use std::time::Duration;
use tauri_plugin_mihomo::models::{ConnectionId, WebSocketMessage};
use tauri_plugin_mihomo::models::{WebSocketConnectionId, WebSocketMessage};
use tokio::sync::mpsc;
use tokio::time::Instant;
@@ -39,7 +39,7 @@ enum InternalWsEvent<T> {
/// Mihomo WebSocket 订阅句柄(通用事件流)。
pub struct MihomoWsEventStream<T> {
/// 当前订阅连接 ID,用于主动断开。
pub connection_id: ConnectionId,
pub connection_id: WebSocketConnectionId,
/// 当前订阅消息接收器。
receiver: mpsc::Receiver<InternalWsEvent<T>>,
/// 最近一次收到有效事件的时间戳。
@@ -162,7 +162,7 @@ impl<T> MihomoWsEventStream<T> {
///
/// # Arguments
/// * `connection_id` - 目标连接 ID
pub async fn disconnect_connection(connection_id: ConnectionId) {
pub async fn disconnect_connection(connection_id: WebSocketConnectionId) {
if let Err(err) = handle::Handle::mihomo()
.await
.disconnect(connection_id, Some(MIHOMO_WS_STREAM_CLOSE_CODE))