pub struct AuthDialog {
stack: TemplateChild<Stack>,
session: WeakRef<Session>,
is_presented: Cell<bool>,
state: RefCell<Option<AuthState>>,
current_page: RefCell<Option<Widget>>,
notifier: OnceCell<OneshotNotifier<Option<()>>>,
abort_handle: RefCell<Option<AbortHandle>>,
}Fields§
§stack: TemplateChild<Stack>§session: WeakRef<Session>The parent session.
is_presented: Cell<bool>Whether this dialog is presented.
state: RefCell<Option<AuthState>>The current state of the authentication.
None means that the authentication has not started yet.
current_page: RefCell<Option<Widget>>The page for the current stage.
notifier: OnceCell<OneshotNotifier<Option<()>>>The notifier to signal to perform the current stage.
abort_handle: RefCell<Option<AbortHandle>>The handle to abort the current future.
Implementations§
Source§impl AuthDialog
impl AuthDialog
Sourcefn register_type()
fn register_type()
Registers the type only once.
Source§impl AuthDialog
impl AuthDialog
Sourcefn notifier(&self) -> &OneshotNotifier<Option<()>>
fn notifier(&self) -> &OneshotNotifier<Option<()>>
The notifier to signal to perform the current stage.
Sourcepub(super) async fn authenticate<Response, Fut, FN>(
&self,
parent: &Widget,
callback: FN,
) -> Result<Response, AuthError>
pub(super) async fn authenticate<Response, Fut, FN>( &self, parent: &Widget, callback: FN, ) -> Result<Response, AuthError>
Authenticate the user to the server via an interactive authentication flow.
The type of flow and the required stages are negotiated during the authentication. Returns the last server response on success.
Sourcepub(super) async fn reset_cross_signing(
&self,
parent: &Widget,
) -> Result<(), AuthError>
pub(super) async fn reset_cross_signing( &self, parent: &Widget, ) -> Result<(), AuthError>
Reset the cross-signing keys while handling the interactive authentication flow.
The type of flow and the required stages are negotiated during the authentication.
Note that due to the implementation of the underlying SDK API, this will not work if there are several stages in the flow.
Returns the last server response on success.
Sourceasync fn await_tokio_task<Response>(
&self,
handle: JoinHandle<Result<Response, Error>>,
) -> Result<Response, AuthError>where
Response: Send + 'static,
async fn await_tokio_task<Response>(
&self,
handle: JoinHandle<Result<Response, Error>>,
) -> Result<Response, AuthError>where
Response: Send + 'static,
Await the given tokio task, handling if it is aborted.
Sourceasync fn perform_uiaa<Response, Fut, FN>(
&self,
uiaa_info: UiaaInfo,
parent: &Widget,
callback: FN,
) -> Result<Response, AuthError>
async fn perform_uiaa<Response, Fut, FN>( &self, uiaa_info: UiaaInfo, parent: &Widget, callback: FN, ) -> Result<Response, AuthError>
Perform UIAA for the given callback, starting with the given UIAA info.
Sourceasync fn perform_next_stage(
&self,
uiaa_info: &UiaaInfo,
parent: &Widget,
) -> Result<AuthData, AuthError>
async fn perform_next_stage( &self, uiaa_info: &UiaaInfo, parent: &Widget, ) -> Result<AuthData, AuthError>
Perform the preferred next stage in the given UIAA info.
Stages that are actually supported are preferred. If no stages are supported, we use the web-based fallback.
When this function returns, the next stage is ready to be performed.
fn retry_current_stage(&self, stage: &AuthType, uiaa_info: &UiaaInfo)
Sourcefn show_page(&self, page: Widget, default_widget: &Widget, parent: &Widget)
fn show_page(&self, page: Widget, default_widget: &Widget, parent: &Widget)
Show the given page.
Sourceasync fn page(&self, state: &AuthState) -> Result<(Widget, Widget), AuthError>
async fn page(&self, state: &AuthState) -> Result<(Widget, Widget), AuthError>
Get the page for the given state.
Returns a (page, default_widget) tuple.
Sourceasync fn fallback_url(&self, state: &AuthState) -> Result<String, AuthError>
async fn fallback_url(&self, state: &AuthState) -> Result<String, AuthError>
Get the fallback URL for the given state.
Sourcefn current_stage_auth_data(&self) -> Result<AuthData, AuthError>
fn current_stage_auth_data(&self) -> Result<AuthData, AuthError>
Get the authentication data for the current stage.
fn close(&self)
Trait Implementations§
Source§impl AdwDialogImpl for AuthDialog
impl AdwDialogImpl for AuthDialog
Source§impl CompositeTemplate for AuthDialog
impl CompositeTemplate for AuthDialog
fn bind_template(klass: &mut Self::Class)
fn check_template_children(widget: &<Self as ObjectSubclass>::Type)
Source§impl Debug for AuthDialog
impl Debug for AuthDialog
Source§impl Default for AuthDialog
impl Default for AuthDialog
Source§fn default() -> AuthDialog
fn default() -> AuthDialog
Source§impl DerivedObjectProperties for AuthDialog
impl DerivedObjectProperties for AuthDialog
Source§fn derived_properties() -> &'static [ParamSpec]
fn derived_properties() -> &'static [ParamSpec]
Source§fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
ObjectImpl but auto-generated by the Properties macro
to allow handling more complex use-cases.Source§fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
ObjectImpl but auto-generated by the Properties macro
to allow handling more complex use-cases.Source§impl ObjectImpl for AuthDialog
impl ObjectImpl for AuthDialog
Source§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
Source§fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
Source§fn constructed(&self)
fn constructed(&self)
Source§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
self.notify("property").fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
Source§impl ObjectSubclass for AuthDialog
impl ObjectSubclass for AuthDialog
Source§type Interfaces = ()
type Interfaces = ()
Source§type Class = ClassStruct<AuthDialog>
type Class = ClassStruct<AuthDialog>
Source§type Instance = InstanceStruct<AuthDialog>
type Instance = InstanceStruct<AuthDialog>
Source§type Type = AuthDialog
type Type = AuthDialog
wrapper!Source§type ParentType = ToastableDialog
type ParentType = ToastableDialog
Source§fn class_init(klass: &mut Self::Class)
fn class_init(klass: &mut Self::Class)
Source§fn instance_init(obj: &InitializingObject<Self>)
fn instance_init(obj: &InitializingObject<Self>)
Source§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
Source§fn type_init(_type_: &mut InitializingType<Self>)
fn type_init(_type_: &mut InitializingType<Self>)
Source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
Source§impl ObjectSubclassType for AuthDialog
impl ObjectSubclassType for AuthDialog
Source§impl WidgetImpl for AuthDialog
impl WidgetImpl for AuthDialog
fn compute_expand(&self, hexpand: &mut bool, vexpand: &mut bool)
fn contains(&self, x: f64, y: f64) -> bool
fn direction_changed(&self, previous_direction: TextDirection)
fn focus(&self, direction_type: DirectionType) -> bool
fn request_mode(&self) -> SizeRequestMode
fn grab_focus(&self) -> bool
fn map(&self)
fn measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)
fn mnemonic_activate(&self, group_cycling: bool) -> bool
fn move_focus(&self, direction_type: DirectionType)
fn query_tooltip( &self, x: i32, y: i32, keyboard_tooltip: bool, tooltip: &Tooltip, ) -> bool
fn realize(&self)
fn root(&self)
fn set_focus_child(&self, child: Option<&Widget>)
fn size_allocate(&self, width: i32, height: i32, baseline: i32)
fn snapshot(&self, snapshot: &Snapshot)
fn state_flags_changed(&self, state_flags: &StateFlags)
fn system_setting_changed(&self, settings: &SystemSetting)
fn unmap(&self)
fn unrealize(&self)
fn unroot(&self)
impl ToastableDialogImpl for AuthDialog
Auto Trait Implementations§
impl !Freeze for AuthDialog
impl !RefUnwindSafe for AuthDialog
impl !Send for AuthDialog
impl !Sync for AuthDialog
impl Unpin for AuthDialog
impl UnsafeUnpin for AuthDialog
impl !UnwindSafe for AuthDialog
Blanket Implementations§
Source§impl<T> AdwDialogImplExt for Twhere
T: AdwDialogImpl,
impl<T> AdwDialogImplExt for Twhere
T: AdwDialogImpl,
fn parent_close_attempt(&self)
fn parent_closed(&self)
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> CompositeTemplateDisposeExt for Twhere
T: WidgetImpl + CompositeTemplate,
impl<T> CompositeTemplateDisposeExt for Twhere
T: WidgetImpl + CompositeTemplate,
fn dispose_template(&self)
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
Source§fn parent_constructed(&self)
fn parent_constructed(&self)
glib::Object::constructed().Source§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
glib::Object::notify().Source§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
glib::Object::dispatch_properties_changed().Source§fn signal_chain_from_overridden(
&self,
token: &SignalClassHandlerToken,
values: &[Value],
) -> Option<Value>
fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>
Source§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
Source§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
Source§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
Source§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
self.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WidgetImplExt for Twhere
T: WidgetImpl,
impl<T> WidgetImplExt for Twhere
T: WidgetImpl,
fn parent_compute_expand(&self, hexpand: &mut bool, vexpand: &mut bool)
fn parent_contains(&self, x: f64, y: f64) -> bool
fn parent_direction_changed(&self, previous_direction: TextDirection)
fn parent_focus(&self, direction_type: DirectionType) -> bool
fn parent_request_mode(&self) -> SizeRequestMode
fn parent_grab_focus(&self) -> bool
Source§fn parent_hide(&self)
fn parent_hide(&self)
Since 4.10
fn parent_map(&self)
fn parent_measure( &self, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)
fn parent_mnemonic_activate(&self, group_cycling: bool) -> bool
fn parent_move_focus(&self, direction_type: DirectionType)
fn parent_query_tooltip( &self, x: i32, y: i32, keyboard_tooltip: bool, tooltip: &Tooltip, ) -> bool
fn parent_realize(&self)
fn parent_root(&self)
fn parent_set_focus_child(&self, child: Option<&Widget>)
Source§fn parent_show(&self)
fn parent_show(&self)
Since 4.10