Struct serde_bool::True
source · pub struct True;Expand description
Type that only deserializes from the true boolean value.
Examples
assert_eq!(
serde_json::from_str::<serde_bool::True>("true").unwrap().as_bool(),
true,
);
serde_json::from_str::<serde_bool::True>("false").unwrap_err();
serde_json::from_str::<serde_bool::True>("42").unwrap_err();Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for True
impl<'de> Deserialize<'de> for True
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<True> for bool
impl PartialEq<True> for bool
source§impl PartialEq<bool> for True
impl PartialEq<bool> for True
source§impl PartialEq for True
impl PartialEq for True
impl Copy for True
impl Eq for True
impl StructuralEq for True
impl StructuralPartialEq for True
Auto Trait Implementations§
impl RefUnwindSafe for True
impl Send for True
impl Sync for True
impl Unpin for True
impl UnwindSafe for True
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