gio::prelude

Trait TlsInteractionExt

Source
pub trait TlsInteractionExt: IsA<TlsInteraction> + 'static {
    // Provided methods
    fn ask_password(
        &self,
        password: &impl IsA<TlsPassword>,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<TlsInteractionResult, Error> { ... }
    fn ask_password_async<P: FnOnce(Result<TlsInteractionResult, Error>) + 'static>(
        &self,
        password: &impl IsA<TlsPassword>,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    ) { ... }
    fn ask_password_future(
        &self,
        password: &(impl IsA<TlsPassword> + Clone + 'static),
    ) -> Pin<Box_<dyn Future<Output = Result<TlsInteractionResult, Error>> + 'static>> { ... }
    fn invoke_ask_password(
        &self,
        password: &impl IsA<TlsPassword>,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<TlsInteractionResult, Error> { ... }
    fn invoke_request_certificate(
        &self,
        connection: &impl IsA<TlsConnection>,
        flags: TlsCertificateRequestFlags,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<TlsInteractionResult, Error> { ... }
    fn request_certificate(
        &self,
        connection: &impl IsA<TlsConnection>,
        flags: TlsCertificateRequestFlags,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<TlsInteractionResult, Error> { ... }
    fn request_certificate_async<P: FnOnce(Result<TlsInteractionResult, Error>) + 'static>(
        &self,
        connection: &impl IsA<TlsConnection>,
        flags: TlsCertificateRequestFlags,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    ) { ... }
    fn request_certificate_future(
        &self,
        connection: &(impl IsA<TlsConnection> + Clone + 'static),
        flags: TlsCertificateRequestFlags,
    ) -> Pin<Box_<dyn Future<Output = Result<TlsInteractionResult, Error>> + 'static>> { ... }
}
Expand description

Trait containing all TlsInteraction methods.

§Implementors

TlsInteraction

Provided Methods§

Source

fn ask_password( &self, password: &impl IsA<TlsPassword>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<TlsInteractionResult, Error>

Run synchronous interaction to ask the user for a password. In general, g_tls_interaction_invoke_ask_password() should be used instead of this function.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The @password value will be filled in and then @callback will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

If the interaction is cancelled by the cancellation object, or by the user then TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

§password

a #GTlsPassword object

§cancellable

an optional #GCancellable cancellation object

§Returns

The status of the ask password interaction.

Source

fn ask_password_async<P: FnOnce(Result<TlsInteractionResult, Error>) + 'static>( &self, password: &impl IsA<TlsPassword>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Run asynchronous interaction to ask the user for a password. In general, g_tls_interaction_invoke_ask_password() should be used instead of this function.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The @password value will be filled in and then @callback will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

If the interaction is cancelled by the cancellation object, or by the user then TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

Certain implementations may not support immediate cancellation.

§password

a #GTlsPassword object

§cancellable

an optional #GCancellable cancellation object

§callback

will be called when the interaction completes

Source

fn ask_password_future( &self, password: &(impl IsA<TlsPassword> + Clone + 'static), ) -> Pin<Box_<dyn Future<Output = Result<TlsInteractionResult, Error>> + 'static>>

Source

fn invoke_ask_password( &self, password: &impl IsA<TlsPassword>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<TlsInteractionResult, Error>

Invoke the interaction to ask the user for a password. It invokes this interaction in the main loop, specifically the #GMainContext returned by g_main_context_get_thread_default() when the interaction is created. This is called by called by #GTlsConnection or #GTlsDatabase to ask the user for a password.

Derived subclasses usually implement a password prompt, although they may also choose to provide a password from elsewhere. The @password value will be filled in and then @callback will be called. Alternatively the user may abort this password request, which will usually abort the TLS connection.

The implementation can either be a synchronous (eg: modal dialog) or an asynchronous one (eg: modeless dialog). This function will take care of calling which ever one correctly.

If the interaction is cancelled by the cancellation object, or by the user then TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

§password

a #GTlsPassword object

§cancellable

an optional #GCancellable cancellation object

§Returns

The status of the ask password interaction.

Source

fn invoke_request_certificate( &self, connection: &impl IsA<TlsConnection>, flags: TlsCertificateRequestFlags, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<TlsInteractionResult, Error>

Invoke the interaction to ask the user to choose a certificate to use with the connection. It invokes this interaction in the main loop, specifically the #GMainContext returned by g_main_context_get_thread_default() when the interaction is created. This is called by called by #GTlsConnection when the peer requests a certificate during the handshake.

Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. Alternatively the user may abort this certificate request, which may or may not abort the TLS connection.

The implementation can either be a synchronous (eg: modal dialog) or an asynchronous one (eg: modeless dialog). This function will take care of calling which ever one correctly.

If the interaction is cancelled by the cancellation object, or by the user then TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

§connection

a #GTlsConnection object

§flags

flags providing more information about the request

§cancellable

an optional #GCancellable cancellation object

§Returns

The status of the certificate request interaction.

Source

fn request_certificate( &self, connection: &impl IsA<TlsConnection>, flags: TlsCertificateRequestFlags, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<TlsInteractionResult, Error>

Run synchronous interaction to ask the user to choose a certificate to use with the connection. In general, g_tls_interaction_invoke_request_certificate() should be used instead of this function.

Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. Alternatively the user may abort this certificate request, which will usually abort the TLS connection.

If TlsInteractionResult::Handled is returned, then the #GTlsConnection passed to g_tls_interaction_request_certificate() will have had its #GTlsConnection:certificate filled in.

If the interaction is cancelled by the cancellation object, or by the user then TlsInteractionResult::Failed will be returned with an error that contains a IOErrorEnum::Cancelled error code. Certain implementations may not support immediate cancellation.

§connection

a #GTlsConnection object

§flags

flags providing more information about the request

§cancellable

an optional #GCancellable cancellation object

§Returns

The status of the request certificate interaction.

Source

fn request_certificate_async<P: FnOnce(Result<TlsInteractionResult, Error>) + 'static>( &self, connection: &impl IsA<TlsConnection>, flags: TlsCertificateRequestFlags, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Run asynchronous interaction to ask the user for a certificate to use with the connection. In general, g_tls_interaction_invoke_request_certificate() should be used instead of this function.

Derived subclasses usually implement a certificate selector, although they may also choose to provide a certificate from elsewhere. @callback will be called when the operation completes. Alternatively the user may abort this certificate request, which will usually abort the TLS connection.

§connection

a #GTlsConnection object

§flags

flags providing more information about the request

§cancellable

an optional #GCancellable cancellation object

§callback

will be called when the interaction completes

Source

fn request_certificate_future( &self, connection: &(impl IsA<TlsConnection> + Clone + 'static), flags: TlsCertificateRequestFlags, ) -> Pin<Box_<dyn Future<Output = Result<TlsInteractionResult, Error>> + 'static>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§