pub struct DedupSerializer {
ser: RefCell<TypeMap<SerializeTableMapper>>,
de: RefCell<TypeMap<DeserializeTableMapper>>,
}Expand description
Deduplicate the values of each type, in one table per type.
Fields§
§ser: RefCell<TypeMap<SerializeTableMapper>>§de: RefCell<TypeMap<DeserializeTableMapper>>Trait Implementations§
Source§impl DedupSerializerState for DedupSerializer
impl DedupSerializerState for DedupSerializer
Source§fn record_serialized<T: Dedup>(
&self,
value: &T,
) -> Option<Result<DedupId, DedupId>>
fn record_serialized<T: Dedup>( &self, value: &T, ) -> Option<Result<DedupId, DedupId>>
Record that we’re serializing this value. Returns
None if we’re not deduplicating
values, Some(Ok(id)) the first time we meet a given value (it must then be serialized
in full), and Some(Err(id)) afterwards (only the id must be serialized).Source§fn record_deserialized<T: Dedup>(&self, id: DedupId, value: T)
fn record_deserialized<T: Dedup>(&self, id: DedupId, value: T)
Record that we deserialized the value with this id.
Source§impl Default for DedupSerializer
impl Default for DedupSerializer
Source§fn default() -> DedupSerializer
fn default() -> DedupSerializer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for DedupSerializer
impl !RefUnwindSafe for DedupSerializer
impl !Sync for DedupSerializer
impl !UnwindSafe for DedupSerializer
impl Send for DedupSerializer
impl Unpin for DedupSerializer
impl UnsafeUnpin for DedupSerializer
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> ⓘ
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