pub struct CmdResult<T> {
pub content: String,
pub status: bool,
pub opts: T,
}Expand description
CMD结构
Fields§
§content: String内容
status: bool状态
opts: T其他参数
Implementations§
source§impl<'a, T> CmdResult<T>where
T: Deserialize<'a>,
impl<'a, T> CmdResult<T>where
T: Deserialize<'a>,
sourcepub fn from_str(value: &'a str) -> Result<Self>
pub fn from_str(value: &'a str) -> Result<Self>
#解析如
use e_utils::system::cmd::CmdResult;
let s = r#"R<{"content":"Windows(R), Education edition:\r\n 批量激活将于 2024/11/18 8:31:18 过期\r\n\r\n","status":true,"opts":{"api":"Os","task":"check","command":["1"]}}>R"#;
println!("{}", CmdResult::from_str(s).unwrap());Trait Implementations§
source§impl<'de, T> Deserialize<'de> for CmdResult<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for CmdResult<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for CmdResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for CmdResult<T>where
T: RefUnwindSafe,
impl<T> Send for CmdResult<T>where
T: Send,
impl<T> Sync for CmdResult<T>where
T: Sync,
impl<T> Unpin for CmdResult<T>where
T: Unpin,
impl<T> UnwindSafe for CmdResult<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more