pub(crate) struct OrderedJson(String);
Expand description
Prerendered json.
Both the Display and serde_json::to_string implementations write the serialized json
Tuple Fields§
§0: String
Implementations§
Source§impl OrderedJson
impl OrderedJson
Sourcepub(crate) fn serialize<T: Serialize>(item: T) -> Result<Self, Error>
pub(crate) fn serialize<T: Serialize>(item: T) -> Result<Self, Error>
If you pass in an array, it will not be sorted.
Sourcepub(crate) fn array_sorted<T: Borrow<Self>, I: IntoIterator<Item = T>>(
items: I,
) -> Self
pub(crate) fn array_sorted<T: Borrow<Self>, I: IntoIterator<Item = T>>( items: I, ) -> Self
Serializes and sorts
pub(crate) fn array_unsorted<T: Borrow<Self>, I: IntoIterator<Item = T>>( items: I, ) -> Self
Trait Implementations§
Source§impl Clone for OrderedJson
impl Clone for OrderedJson
Source§fn clone(&self) -> OrderedJson
fn clone(&self) -> OrderedJson
Returns a copy 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 Debug for OrderedJson
impl Debug for OrderedJson
Source§impl<'de> Deserialize<'de> for OrderedJson
impl<'de> Deserialize<'de> for OrderedJson
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 Display for OrderedJson
impl Display for OrderedJson
Source§impl From<OrderedJson> for EscapedJson
impl From<OrderedJson> for EscapedJson
Source§fn from(json: OrderedJson) -> Self
fn from(json: OrderedJson) -> Self
Converts to this type from the input type.
Source§impl From<OrderedJson> for Value
impl From<OrderedJson> for Value
Source§fn from(json: OrderedJson) -> Self
fn from(json: OrderedJson) -> Self
Converts to this type from the input type.
Source§impl From<Value> for OrderedJson
impl From<Value> for OrderedJson
Source§impl Ord for OrderedJson
impl Ord for OrderedJson
Source§fn cmp(&self, other: &OrderedJson) -> Ordering
fn cmp(&self, other: &OrderedJson) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OrderedJson
impl PartialEq for OrderedJson
Source§impl PartialOrd for OrderedJson
impl PartialOrd for OrderedJson
Source§impl Serialize for OrderedJson
impl Serialize for OrderedJson
impl Eq for OrderedJson
impl StructuralPartialEq for OrderedJson
Auto Trait Implementations§
impl Freeze for OrderedJson
impl RefUnwindSafe for OrderedJson
impl Send for OrderedJson
impl Sync for OrderedJson
impl Unpin for OrderedJson
impl UnwindSafe for OrderedJson
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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 moreSource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes