pub struct CommandWrap<'a> { /* private fields */ }Expand description
Wrapper of Command to deserialize.
const CLAP_TOML: &'static str = r#"
name = "app_clap_serde"
version = "1.0"
author = "tester"
about = "test-clap-serde"
"#;
let app: clap::Command = toml::from_str::<clap_serde::CommandWrap>(CLAP_TOML)
.expect("parse failed")
.into();
assert_eq!(app.get_name(), "app_clap_serde");
assert_eq!(app.get_about(), Some("test-clap-serde"));Trait Implementations§
Source§impl<'a> Clone for CommandWrap<'a>
impl<'a> Clone for CommandWrap<'a>
Source§fn clone(&self) -> CommandWrap<'a>
fn clone(&self) -> CommandWrap<'a>
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 moreSource§impl<'a> Debug for CommandWrap<'a>
impl<'a> Debug for CommandWrap<'a>
Source§impl<'a> Deref for CommandWrap<'a>
impl<'a> Deref for CommandWrap<'a>
Source§impl<'de> Deserialize<'de> for CommandWrap<'de>
impl<'de> Deserialize<'de> for CommandWrap<'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
Source§impl<'de> DeserializeSeed<'de> for CommandWrap<'de>
impl<'de> DeserializeSeed<'de> for CommandWrap<'de>
Source§type Value = CommandWrap<'de>
type Value = CommandWrap<'de>
The type produced by using this seed.
Source§fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>where
D: Deserializer<'de>,
Equivalent to the more common
Deserialize::deserialize method, except
with some initial piece of data (the seed) passed in.Source§impl<'a> From<App<'a>> for CommandWrap<'a>
impl<'a> From<App<'a>> for CommandWrap<'a>
Source§impl<'a> From<CommandWrap<'a>> for Command<'a>
impl<'a> From<CommandWrap<'a>> for Command<'a>
Source§fn from(a: CommandWrap<'a>) -> Self
fn from(a: CommandWrap<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for CommandWrap<'a>
impl<'a> !RefUnwindSafe for CommandWrap<'a>
impl<'a> Send for CommandWrap<'a>
impl<'a> Sync for CommandWrap<'a>
impl<'a> Unpin for CommandWrap<'a>
impl<'a> !UnwindSafe for CommandWrap<'a>
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