pub struct PhoneNumber { /* private fields */ }
Implementations§
source§impl PhoneNumber
impl PhoneNumber
sourcepub fn get(&self) -> Result<Option<String>>
pub fn get(&self) -> Result<Option<String>>
Query for a previously verified phone number.
Requires network: no
sourcepub fn register(&self, phone_number: String) -> Result<()>
pub fn register(&self, phone_number: String) -> Result<()>
Start the verification process for a new phone number. This will trigger an SMS containing
an OTP to be sent to the provided phone_number
. To conclude the verification process,
the method PhoneNumber::verify
should be called next.
Parameters:
phone_number
- the phone number to be registered. Needs to be checked for validity using PhoneNumber::parse_to_lightning_address.
Requires network: yes
sourcepub fn verify(&self, phone_number: String, otp: String) -> Result<()>
pub fn verify(&self, phone_number: String, otp: String) -> Result<()>
Finish the verification process for a new phone number.
Parameters:
phone_number
- the phone number to be verified.otp
- the OTP code sent as an SMS to the phone number.
Requires network: yes
sourcepub fn parse_prefix(
&self,
phone_number_prefix: String,
) -> Result<(), ParsePhoneNumberPrefixError>
pub fn parse_prefix( &self, phone_number_prefix: String, ) -> Result<(), ParsePhoneNumberPrefixError>
Parse a phone number prefix, check against the list of allowed countries
(set in LightningNodeConfig::phone_number_allowed_countries_iso_3166_1_alpha_2
).
The parser is not strict, it parses some invalid prefixes as valid.
Requires network: no
sourcepub fn parse_to_lightning_address(
&self,
phone_number: String,
) -> Result<String, ParsePhoneNumberError>
pub fn parse_to_lightning_address( &self, phone_number: String, ) -> Result<String, ParsePhoneNumberError>
Parse a phone number, check against the list of allowed countries
(set in LightningNodeConfig::phone_number_allowed_countries_iso_3166_1_alpha_2
).
Returns a possible lightning address, which can be checked for existence
with Util::decode_data
.
Requires network: no
Auto Trait Implementations§
impl Freeze for PhoneNumber
impl !RefUnwindSafe for PhoneNumber
impl Send for PhoneNumber
impl Sync for PhoneNumber
impl Unpin for PhoneNumber
impl !UnwindSafe for PhoneNumber
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any
.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request