pub struct Property(_, _);
Expand description
Property type captures a single (key,value) pair in a JSON object.
Where,
- key is String type, defined by JSON specification.
- value is JSON value.
Implements PartialEq and PartialOrd for equality and ordering.
Implementations
sourceimpl Property
impl Property
Following inherent methods are self explanatory, typically used to move, or obtain a reference for key or value component of a property.
pub fn new<T>(key: T, value: Json) -> Propertywhere
T: ToString,
pub fn into_key(self) -> String
pub fn as_key(&self) -> &str
pub fn into_value(self) -> Json
pub fn as_value(&self) -> &Json
pub fn as_mut_value(&mut self) -> &mut Json
pub fn set_key(&mut self, key: String)
pub fn set_value(&mut self, value: Json)
Trait Implementations
sourceimpl PartialOrd<Property> for Property
impl PartialOrd<Property> for Property
sourcefn partial_cmp(&self, other: &Property) -> Option<Ordering>
fn partial_cmp(&self, other: &Property) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Property
impl StructuralEq for Property
impl StructuralPartialEq for Property
Auto Trait Implementations
impl RefUnwindSafe for Property
impl Send for Property
impl Sync for Property
impl Unpin for Property
impl UnwindSafe for Property
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more