pub struct Struct(_);
Expand description
A key-value object for representing both maps and structs.
Implementations
sourceimpl Struct
impl Struct
sourcepub fn from_pairs<S, V>(pairs: impl IntoIterator<Item = (S, V)>) -> Structwhere
S: Into<String>,
V: Into<Value>,
pub fn from_pairs<S, V>(pairs: impl IntoIterator<Item = (S, V)>) -> Structwhere
S: Into<String>,
V: Into<Value>,
Convenience method for creating a Struct
directly.
Examples
Struct::from_pairs([
("struct_field", Value::String("struct value".into())),
("another_field", Value::I32(100)),
]);
// Equivalent to the following (JSON) markup:
// {
// "struct_field": "struct value",
// "another_field": 100
// }
Trait Implementations
impl StructuralPartialEq for Struct
Auto Trait Implementations
impl RefUnwindSafe for Struct
impl Send for Struct
impl Sync for Struct
impl Unpin for Struct
impl UnwindSafe for Struct
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