pub struct PlmConnection {
pub status: Status,
pub token_input: String,
pub username: String,
pub password: String,
pub last: Option<Outcome>,
pub link: Option<BrowserLink>,
/* private fields */
}Fields§
§status: Status§token_input: String§username: String§password: String§last: Option<Outcome>§link: Option<BrowserLink>A browser sign-in waiting for the person to approve it.
Implementations§
Source§impl PlmConnection
impl PlmConnection
pub fn new(status: Status, keep: Keep) -> Self
pub fn url(&self) -> &str
pub fn keep(&self) -> &Keep
Sourcepub fn poll(&mut self) -> bool
pub fn poll(&mut self) -> bool
Call once per frame: drive the queue while busy, collect a finished action, and run a browser sign-in’s polls. Returns true when something changed.
Sourcepub fn take_signed_out_here(&mut self) -> bool
pub fn take_signed_out_here(&mut self) -> bool
Forget ended this machine’s sign-in on the server since the last call.
Sourcepub fn take_fresh_token(&mut self) -> Option<(String, String)>
pub fn take_fresh_token(&mut self) -> Option<(String, String)>
A native sign-in that passed since the last call: (username, token).
Sourcepub fn take_open_request(&mut self) -> Option<String>
pub fn take_open_request(&mut self) -> Option<String>
Take the link page a browser sign-in wants opened (once).
Sourcepub fn link_wait(&self) -> Option<f64>
pub fn link_wait(&self) -> Option<f64>
Seconds until the browser sign-in wants a frame (its next poll), or
None when none is running.
Sourcepub fn sign_in_with_browser(&mut self)
pub fn sign_in_with_browser(&mut self)
Start a browser sign-in (native): register with the server, ask for
the link page to be opened in the default browser
(Self::take_open_request), and wait for the person to approve
it there. The server mints this machine’s token on approval.
Sourcepub fn cancel_link(&mut self)
pub fn cancel_link(&mut self)
Stop waiting for the browser. The link expires on the server by itself; an approval after this is never collected.
Sourcepub fn connectable(&self) -> bool
pub fn connectable(&self) -> bool
Connect now is offered: the server took this machine’s sign-in.
Sourcepub fn reconnected(&mut self, outcome: Result<String, String>)
pub fn reconnected(&mut self, outcome: Result<String, String>)
The app’s live switch answered: success is the store’s own news (the next status says Connected); a refusal is shown as this tab’s outcome.
Sourcepub fn set_status(&mut self, status: Status)
pub fn set_status(&mut self, status: Status)
The store’s status moved (a live switch landed): take it.
Sourcepub fn take_reload(&mut self) -> bool
pub fn take_reload(&mut self) -> bool
Take the “reload the page” request a web action left.
Sourcepub fn use_token(&mut self)
pub fn use_token(&mut self)
Sign in with the pasted token: the server must accept it and serve this app before it is kept.
Sourcepub fn use_password(&mut self)
pub fn use_password(&mut self)
Sign in with a username and password: a token for this machine (native), or the PLM’s session (web). The password is not kept.
Auto Trait Implementations§
impl !RefUnwindSafe for PlmConnection
impl !Send for PlmConnection
impl !Sync for PlmConnection
impl !UnwindSafe for PlmConnection
impl Forget for PlmConnection
impl Freeze for PlmConnectionwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const RcInner<RefCell<Option<Outcome>>> is !null: Freeze,
PhantomData<RcInner<RefCell<Option<Outcome>>>>: Freeze,
*const RcInner<dyn Fn(&str) -> Rc<dyn PlmTransport>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&str) -> Rc<dyn PlmTransport>>>: Freeze,
*const RcInner<RefCell<Option<Result<DesktopLink, PlmError>>>> is !null: Freeze,
PhantomData<RcInner<RefCell<Option<Result<DesktopLink, PlmError>>>>>: Freeze,
*const RcInner<RefCell<Option<Result<LinkPoll, PlmError>>>> is !null: Freeze,
PhantomData<RcInner<RefCell<Option<Result<LinkPoll, PlmError>>>>>: Freeze,
*const RcInner<dyn Fn() -> f64> is !null: Freeze,
PhantomData<RcInner<dyn Fn() -> f64>>: Freeze,
*const RcInner<RefCell<Option<(String, String)>>> is !null: Freeze,
PhantomData<RcInner<RefCell<Option<(String, String)>>>>: Freeze,
*const RcInner<RefCell<Option<()>>> is !null: Freeze,
PhantomData<RcInner<RefCell<Option<()>>>>: Freeze,
impl Move for PlmConnection
impl Unpin for PlmConnectionwhere
*const u8 is !null: Unpin,
Rc<RefCell<Option<Outcome>>>: Unpin,
Rc<dyn Fn(&str) -> Rc<dyn PlmTransport>>: Unpin,
Rc<RefCell<Option<Result<DesktopLink, PlmError>>>>: Unpin,
Rc<RefCell<Option<Result<LinkPoll, PlmError>>>>: Unpin,
Rc<dyn Fn() -> f64>: Unpin,
Rc<RefCell<Option<(String, String)>>>: Unpin,
Rc<RefCell<Option<()>>>: Unpin,
impl UnsafeUnpin for PlmConnectionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<RefCell<Option<Outcome>>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<Option<Outcome>>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&str) -> Rc<dyn PlmTransport>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&str) -> Rc<dyn PlmTransport>>>: UnsafeUnpin,
*const RcInner<RefCell<Option<Result<DesktopLink, PlmError>>>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<Option<Result<DesktopLink, PlmError>>>>>: UnsafeUnpin,
*const RcInner<RefCell<Option<Result<LinkPoll, PlmError>>>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<Option<Result<LinkPoll, PlmError>>>>>: UnsafeUnpin,
*const RcInner<dyn Fn() -> f64> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn() -> f64>>: UnsafeUnpin,
*const RcInner<RefCell<Option<(String, String)>>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<Option<(String, String)>>>>: UnsafeUnpin,
*const RcInner<RefCell<Option<()>>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<Option<()>>>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.