pub struct PtrAsInner;Expand description
Serialises a shared pointer to some object x as a tuple (ID, X), where:
IDis the unique and immutable ID of the object. (See: HasId)Xis a full copy of the object’s value. (Seex’s implementation of the Serialize trait for details)
On de-serialisation, independent copies of the object with the same ID are created.
§WARNING
De-serialisation makes no attempt to restore shared pointers.
Two pointers to the same value x will be de-serialised as two separate copies
of it, x' and x''. Mutating the value of x' will not change the value of x''.
After de-serialising an entire structure, it is the user’s responsibility to go through it and manually restore the shared pointers. See the de-serialisation code for [Model] for an example.
Trait Implementations§
Source§impl<'de, T> DeserializeAs<'de, T> for PtrAsInnerwhere
T: IdPtr,
T::Data: Deserialize<'de>,
impl<'de, T> DeserializeAs<'de, T> for PtrAsInnerwhere
T: IdPtr,
T::Data: Deserialize<'de>,
Source§fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
Source§impl<T> SerializeAs<T> for PtrAsInnerwhere
T: IdPtr,
impl<T> SerializeAs<T> for PtrAsInnerwhere
T: IdPtr,
Source§fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for PtrAsInner
impl RefUnwindSafe for PtrAsInner
impl Send for PtrAsInner
impl Sync for PtrAsInner
impl Unpin for PtrAsInner
impl UnsafeUnpin for PtrAsInner
impl UnwindSafe for PtrAsInner
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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: 0 bytes