pub enum LearningSource {
Usync,
PeerPnMessage,
PeerLidMessage,
RecipientLatestLid,
MigrationSyncLatest,
MigrationSyncOld,
BlocklistActive,
BlocklistInactive,
Pairing,
DeviceNotification,
Other,
}Expand description
The source from which a LID-PN mapping was learned.
The source is load-bearing, not just provenance: it selects the write
policy applied when the pair reaches the cache — see lid_pn_write_policy
in the whatsapp-rust client, which mirrors WhatsApp Web’s
createLidPnMappings switch (learningSource). Directed sources overwrite
on any change; observational bulk sources (Other and friends, WA Web
"other") only seed new LIDs and re-resolve conflicts via a live query;
known-stale sources are stamped created_at = 0 so they never outrank a
fresher mapping for the same phone (the PN→LID resolution direction; the
LID→PN reverse map always takes the latest write).
Variants§
Usync
Mapping learned from usync (device sync) query response
PeerPnMessage
Mapping learned from incoming message with sender_lid attribute (sender is PN)
PeerLidMessage
Mapping learned from incoming message with sender_pn attribute (sender is LID)
RecipientLatestLid
Mapping learned when looking up recipient’s latest LID
MigrationSyncLatest
Mapping learned from latest history sync migration
MigrationSyncOld
Mapping learned from old history sync records
BlocklistActive
Mapping learned from active blocklist entry
BlocklistInactive
Mapping learned from inactive blocklist entry
Pairing
Mapping learned from device pairing (own JID <-> LID)
DeviceNotification
Mapping learned from device notification (when lid attribute present)
Other
Mapping learned from other/unknown source
Implementations§
Source§impl LearningSource
impl LearningSource
Sourcepub fn parse(s: &str) -> LearningSource
pub fn parse(s: &str) -> LearningSource
Parse from database string (unknown values map to Other)
Trait Implementations§
Source§impl Clone for LearningSource
impl Clone for LearningSource
Source§fn clone(&self) -> LearningSource
fn clone(&self) -> LearningSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LearningSource
Source§impl Debug for LearningSource
impl Debug for LearningSource
Source§impl Default for LearningSource
impl Default for LearningSource
Source§fn default() -> LearningSource
fn default() -> LearningSource
Source§impl<'de> Deserialize<'de> for LearningSource
impl<'de> Deserialize<'de> for LearningSource
Source§fn deserialize<D>(
deserializer: D,
) -> Result<LearningSource, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<LearningSource, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for LearningSource
impl Display for LearningSource
impl Eq for LearningSource
Source§impl ParseStringEnum for LearningSource
impl ParseStringEnum for LearningSource
fn parse_from_str(s: &str) -> Result<LearningSource, Error>
Source§impl PartialEq for LearningSource
impl PartialEq for LearningSource
Source§impl Serialize for LearningSource
impl Serialize for LearningSource
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for LearningSource
Auto Trait Implementations§
impl Freeze for LearningSource
impl RefUnwindSafe for LearningSource
impl Send for LearningSource
impl Sync for LearningSource
impl Unpin for LearningSource
impl UnsafeUnpin for LearningSource
impl UnwindSafe for LearningSource
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreimpl<T> MaybeSend for T
impl<T> MaybeSendSync for T
impl<T> Spawnable for Twhere
T: Send + 'static,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more