#[non_exhaustive]pub enum PairCodeError {
Show 16 variants
PhoneNumberRequired,
PhoneNumberTooShort,
PhoneNumberNotInternational,
InvalidCustomCode,
CodeAlreadyOutstanding {
remaining: Duration,
},
InvalidWrappedData {
expected: usize,
got: usize,
},
InvalidPrimaryEphemeralKey(CurveError),
InvalidPrimaryIdentityKey(CurveError),
EphemeralKeyAgreement(CurveError),
IdentityKeyAgreement(CurveError),
AdvSecretKeyDerivation,
BundleKeyDerivation,
BundleAead(CryptoProviderError),
NotWaiting,
MissingPairingRef,
Cancelled,
}Expand description
Errors raised by wacore-side pair-code validation, key derivation, and
protocol-bundle building. The high-level crate wraps this in
whatsapp_rust::pair_code::PairError and adds an IQ-failure variant for the
transport layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PhoneNumberRequired
PhoneNumberTooShort
PhoneNumberNotInternational
InvalidCustomCode
CodeAlreadyOutstanding
A code is already displayed and still within its validity window.
Minting a second one does not replace the first for the phone: the
server routes primary_hello by number, so whoever enters the older
code still reaches stage 2 and receives a key bundle their code cannot
open — the phone reports a failed link and the companion sees nothing.
WA Web forbids the overlap with invariant(stage === Initialized).
Cancel the outstanding flow first if the replacement is intentional.
InvalidWrappedData
InvalidPrimaryEphemeralKey(CurveError)
InvalidPrimaryIdentityKey(CurveError)
EphemeralKeyAgreement(CurveError)
IdentityKeyAgreement(CurveError)
AdvSecretKeyDerivation
BundleKeyDerivation
BundleAead(CryptoProviderError)
NotWaiting
MissingPairingRef
Cancelled
The flow was cancelled (or replaced) while companion_hello was in
flight, so the code stage 1 produced was never installed.
Trait Implementations§
Source§impl Debug for PairCodeError
impl Debug for PairCodeError
Source§impl Display for PairCodeError
impl Display for PairCodeError
Source§impl Error for PairCodeError
impl Error for PairCodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<PairCodeError> for PairError
impl From<PairCodeError> for PairError
Source§fn from(source: PairCodeError) -> Self
fn from(source: PairCodeError) -> Self
Auto Trait Implementations§
impl Freeze for PairCodeError
impl RefUnwindSafe for PairCodeError
impl Send for PairCodeError
impl Sync for PairCodeError
impl Unpin for PairCodeError
impl UnsafeUnpin for PairCodeError
impl UnwindSafe for PairCodeError
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> 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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<E> ErrorChainExt for Ewhere
E: Error + 'static,
impl<E> ErrorChainExt for Ewhere
E: Error + 'static,
fn as_dyn_error(&self) -> &(dyn Error + 'static)
Source§fn sources(&self) -> Sources<'_> ⓘ
fn sources(&self) -> Sources<'_> ⓘ
Source§fn server_rejection(&self) -> Option<ServerRejection<'_>>
fn server_rejection(&self) -> Option<ServerRejection<'_>>
Source§fn is_timeout(&self) -> bool
fn is_timeout(&self) -> bool
Source§fn store_failure(&self) -> Option<&StoreError>
fn store_failure(&self) -> Option<&StoreError>
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