pub struct RcRefCellAsId;
Expand description
De/Serialize an Rc<RefCell<T>>
as the id of the inner value T
.
On de-serialization, each object is created as the default value for that type, except with the id’s being retained.
It is left to the user to fix these values before use. Before serialization, each object in
memory has a unique id; using this information, re-constructing the shared pointers should be
possible, as long as the contents of each object were also stored, e.g. with
RcRefCellAsInner
.
Trait Implementations§
Source§impl<'de, T> DeserializeAs<'de, Rc<RefCell<T>>> for RcRefCellAsIdwhere
T: HasId + DefaultWithId,
impl<'de, T> DeserializeAs<'de, Rc<RefCell<T>>> for RcRefCellAsIdwhere
T: HasId + DefaultWithId,
Source§fn deserialize_as<D>(
deserializer: D,
) -> Result<Rc<RefCell<T>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<Rc<RefCell<T>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
Source§impl<T> SerializeAs<Rc<RefCell<T>>> for RcRefCellAsIdwhere
T: HasId,
impl<T> SerializeAs<Rc<RefCell<T>>> for RcRefCellAsIdwhere
T: HasId,
Source§fn serialize_as<S>(
source: &Rc<RefCell<T>>,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize_as<S>(
source: &Rc<RefCell<T>>,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
Auto Trait Implementations§
impl Freeze for RcRefCellAsId
impl RefUnwindSafe for RcRefCellAsId
impl Send for RcRefCellAsId
impl Sync for RcRefCellAsId
impl Unpin for RcRefCellAsId
impl UnwindSafe for RcRefCellAsId
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
§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>
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 more