[−][src]Struct ashpd::RequestProxy
The Request interface is shared by all portal interfaces. When a portal method is called, the reply includes a handle (i.e. object path) for a Request object, which will stay alive for the duration of the user interaction related to the method call.
The portal indicates that a portal request interaction is over by emitting the "Response" signal on the Request object.
The application can abort the interaction calling Close() on the Request object.
Since version 0.9 of xdg-desktop-portal, the handle will be of the form
/org/freedesktop/portal/desktop/request/SENDER/TOKEN
, where SENDER is the callers unique name,
with the initial ':' removed and all '.' replaced by '_',
and TOKEN is a unique token that the caller provided with the handle_token key in the options vardict.
This change was made to let applications subscribe to the Response signal before making the initial portal call, thereby avoiding a race condition. It is recommended that the caller should verify that the returned handle is what it expected, and update its signal subscription if it isn't. This ensures that applications will work with both old and new versions of xdg-desktop-portal.
Implementations
impl<'a> RequestProxy<'a>
[src]
pub fn new(
connection: &'a Connection,
handle: &'a ObjectPath<'_>
) -> Result<Self>
[src]
connection: &'a Connection,
handle: &'a ObjectPath<'_>
) -> Result<Self>
Creates a new request proxy.
Arguments
connection
- A DBus session connection.handle
- An object path returned by a portal call.
pub fn on_response<F, T>(&self, callback: F) -> Result<()> where
F: FnOnce(Response<T>),
T: DeserializeOwned + Type,
[src]
F: FnOnce(Response<T>),
T: DeserializeOwned + Type,
A signal emitted when the portal interaction is over.
pub fn close(&self) -> Result<()>
[src]
Closes the portal request to which this object refers and ends all related user interaction (dialogs, etc). A Response signal will not be emitted in this case.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for RequestProxy<'a>
impl<'a> !Send for RequestProxy<'a>
impl<'a> !Sync for RequestProxy<'a>
impl<'a> Unpin for RequestProxy<'a>
impl<'a> !UnwindSafe for RequestProxy<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,