Skip to main content

Json

Struct Json 

Source
pub struct Json<T> { /* private fields */ }

Implementations§

Source§

impl<T: Serialize> Json<T>

Source

pub fn new(value: T) -> Result<Self>

Trait Implementations§

Source§

impl<T> Clone for Json<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Json<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Deref for Json<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: Eq> Eq for Json<T>

Source§

impl<T: Hash> Hash for Json<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl InlineOutput for Json<()>

Source§

fn slice_to_output(slice: &[Self], output: &mut (impl Output + ?Sized))
where Self: Sized,

Specialisation point to allow types like u8 to provide better serialisation implementation for containers like Vec<u8>.
Source§

impl<T> ListHashes for Json<T>

Source§

fn list_hashes(&self, f: &mut (impl FnMut(Hash) + ?Sized))

[Hash]-only part of Topological::traverse.
Source§

fn topology_hash(&self) -> Hash

[Hash] of all [Hash]es the object refers to other objects by.
Source§

fn point_count(&self) -> usize

How many others this object refers to.
Source§

impl MaybeHasNiche for Json<()>

Source§

type MnArray = SomeNiche<ZeroNiche<<Json<()> as Size>::Size>>

Should implement MnArray. Not constraint explicitly, because that breaks things.
Source§

impl<T: DeserializeOwned + Serialize, I: ParseInput> Parse<I> for Json<T>

Source§

fn parse(input: I) -> Result<Self>

Parse consuming the whole stream.
Source§

impl<T: PartialEq> PartialEq for Json<T>

Source§

fn eq(&self, other: &Json<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Size for Json<()>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

const SIZE: usize = <Self::Size as Unsigned>::USIZE

Source§

impl<T: PartialEq> StructuralPartialEq for Json<T>

Source§

impl<T> Tagged for Json<T>

Source§

const TAGS: Tags = _

Source§

const HASH: Hash = _

Source§

impl<T> ToOutput for Json<T>

Source§

fn to_output(&self, output: &mut (impl ?Sized + Output))

Provide object’s byte representation to an Output.
Source§

fn hasher(&self) -> Sha256

Return a Sha256 hasher pre-filled with data of this object.
Source§

fn data_hash(&self) -> Hash

[Hash] of (real, i.e. serialized) data of this object.
Source§

fn mangle_hash(&self) -> Hash

“Mangle hash” of the object. This is used to introduce runtime distinction between data-identical objects similarly to compile-time Tagged::HASH.
Source§

fn output<T>(&self) -> T
where T: FromOutput, <T as FromOutput>::Output: Default,

Construct an Output, possibly finalising it afterwards. Read more
Source§

fn vec(&self) -> Vec<u8>

Collect this object’s data (serialize the object).
Source§

impl<T> Topological for Json<T>

Source§

fn traverse(&self, visitor: &mut (impl PointVisitor + ?Sized))

List what objects this one refers to. Read more
Source§

fn topology(&self) -> Vec<Arc<dyn Singular>>

Collect references into a dynamically-typed list.
Source§

fn byte_node(&self) -> (Vec<u8>, Arc<dyn Resolve>)
where Self: ToOutput,

Source§

fn to_resolve(&self) -> Arc<dyn Resolve>

Reconstruct a Resolve usable for Parse::parseing this object based on references.
Source§

impl<T: Serialize + Default> TryDefault for Json<T>

Auto Trait Implementations§

§

impl<T> Freeze for Json<T>
where Arc<JsonInner<T>>: Freeze,

§

impl<T> RefUnwindSafe for Json<T>
where Arc<JsonInner<T>>: RefUnwindSafe,

§

impl<T> Send for Json<T>
where Arc<JsonInner<T>>: Send,

§

impl<T> Sync for Json<T>
where Arc<JsonInner<T>>: Sync,

§

impl<T> Unpin for Json<T>
where Arc<JsonInner<T>>: Unpin,

§

impl<T> UnsafeUnpin for Json<T>
where Arc<JsonInner<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for Json<T>
where Arc<JsonInner<T>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T

Source§

fn any_ref(&self) -> &(dyn Any + 'static)
where T: 'static,

Get a shared RTTI reference.
Source§

fn any_mut(&mut self) -> &mut (dyn Any + 'static)
where T: 'static,

Get an exclusive RTTI reference.
Source§

fn any_box(self: Box<T>) -> Box<dyn Any>
where T: 'static,

Get an RTTI Box.
Source§

fn any_arc(self: Arc<T>) -> Arc<dyn Any>
where T: 'static,

Get an RTTI Arc.
Source§

fn any_arc_sync(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
where T: 'static + Send + Sync,

Get an RTTI Arc which is also Send.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Component for T

Source§

impl<T, U> EquivalentFor<U> for T
where U: Equivalent<T>,

Source§

impl<T, Extra> ExtraFor<T> for Extra
where T: for<'a> Parse<Input<'a, Extra>>, Extra: Clone,

Source§

fn parse(&self, data: &[u8], resolve: &Arc<dyn Resolve>) -> Result<T, Error>

Source§

fn parse_checked( &self, hash: Hash, data: &[u8], resolve: &Arc<dyn Resolve>, ) -> Result<T, Error>
where T: FullHash,

Self::parse, then check that FullHash::full_hash matches.
Source§

impl<T, E> ExtraNoneOutput<E> for T
where T: OptionOutput,

Source§

fn extra_some_output(&self, output: &mut (impl Output + ?Sized))

Source§

fn extra_none_output(_: &E, output: &mut (impl Output + ?Sized))

Source§

fn extra_option_output( option: &ExtraOption<T, E>, output: &mut (impl Output + ?Sized), )

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FullHash for T
where T: ToOutput + ListHashes + Tagged + ?Sized,

Source§

fn diff_hashes(&self) -> DiffHashes

Source§

fn with_hash(&self) -> WithHash<'_, Self>

Source§

fn full_hash(&self) -> Hash

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoPoint for T
where T: Traversible,

Source§

fn point(self) -> Point<Self>
where Self: Clone,

Source§

impl<T> LendTo for T
where T: Clone,

Source§

fn lend_to<T>(&mut self, borrower: Borrower<Self>) -> impl Future<Output = T>

Source§

impl<T, Extra> Object<Extra> for T
where T: Traversible + for<'a> Parse<Input<'a, Extra>>,

Source§

impl<T> OptionOutput for T
where T: ToOutput + TaggedOption,

Source§

fn to_option_output(option: Option<&T>, output: &mut (impl Output + ?Sized))

Source§

impl<T, B, I> OptionParse<I> for T
where T: Parse<I> + MaybeHasNiche, <T as MaybeHasNiche>::MnArray: MnArray, <<T as MaybeHasNiche>::MnArray as MnArray>::MaybeNiche: Niche<NeedsTag = B>, B: OptionParseBit<T, I>, I: ParseInput,

Source§

impl<T> ParseSlice for T
where T: for<'a> Parse<Input<'a>>,

Source§

fn parse_slice(slice: &[u8], resolve: &Arc<dyn Resolve>) -> Result<Self, Error>

Source§

fn reparse(&self) -> Result<Self, Error>
where Self: Traversible,

Source§

impl<T, Extra> ParseSliceExtra<Extra> for T
where T: for<'a> Parse<Input<'a, Extra>>, Extra: Clone,

Source§

fn parse_slice_extra( slice: &[u8], resolve: &Arc<dyn Resolve>, extra: &Extra, ) -> Result<Self, Error>

Source§

fn reparse_extra(&self, extra: &Extra) -> Result<Self, Error>
where Self: Traversible,

Source§

impl<T> ParseSliceRefless for T
where T: for<'a> Parse<ReflessInput<'a>>,

Source§

fn parse_slice_refless(slice: &[u8]) -> Result<Self, Error>

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ReflessObject for T
where T: 'static + Send + Sync + ToOutput + Tagged + for<'a> Parse<ReflessInput<'a>>,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SizeExt for T
where T: Size + ToOutput, <T as Size>::Size: ArrayLength,

Source§

fn to_array(&self) -> GenericArray<u8, Self::Size>

Source§

fn reinterpret<T>(&self) -> T
where T: FromSized<Size = Self::Size>,

Source§

impl<T> TagsHash for T
where T: Tagged + ?Sized,

Source§

fn tags_hash(&self) -> Hash

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> Traversible for T
where T: 'static + Send + Sync + FullHash + Topological,

Source§

fn local(self) -> Arc<dyn SingularFetch<T = Self>>
where Self: Clone,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.