From 1b1663c87ef482d94c41b4e93e14db5a794e5dee Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Fri, 1 Mar 2024 21:46:48 +0800 Subject: [PATCH] =?UTF-8?q?[mio]=20=E7=AE=80=E5=8C=96=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnt/src/handle/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vnt/src/handle/mod.rs b/vnt/src/handle/mod.rs index 28db419..efb9c00 100644 --- a/vnt/src/handle/mod.rs +++ b/vnt/src/handle/mod.rs @@ -110,6 +110,15 @@ pub enum ConnectStatus { Connected, } +impl ConnectStatus { + pub fn online(&self) -> bool { + self == &ConnectStatus::Connected + } + pub fn offline(&self) -> bool { + self == &ConnectStatus::Connecting + } +} + #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct CurrentDeviceInfo { //本机虚拟IP